Use shaderc_shared and don't build unnecessary targets
This should speed up compilation on Travis a little bit.
This commit is contained in:
parent
b6fb5f3149
commit
00935daffc
|
@ -17,4 +17,4 @@ build_script:
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
# TODO(cwallez@chromium.org) test on more than Debug.
|
# TODO(cwallez@chromium.org) test on more than Debug.
|
||||||
- src\tests\Debug\nxt_unittests.exe
|
- Debug\nxt_unittests.exe
|
||||||
|
|
|
@ -64,7 +64,7 @@ script:
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
- ./src/tests/nxt_unittests
|
- ./nxt_unittests
|
||||||
|
|
||||||
# Get out of the build dir
|
# Get out of the build dir
|
||||||
- cd ..
|
- cd ..
|
||||||
|
|
|
@ -162,6 +162,10 @@ endfunction()
|
||||||
# Enable the creation of folders for Visual Studio projects
|
# Enable the creation of folders for Visual Studio projects
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
# Output shared libs and executables directly in the build directory
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Generate the C and C++ NXT APIs
|
# Generate the C and C++ NXT APIs
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
@ -55,7 +55,7 @@ if (NXT_ENABLE_VULKAN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(utils STATIC ${UTILS_SOURCES})
|
add_library(utils STATIC ${UTILS_SOURCES})
|
||||||
target_link_libraries(utils nxt_backend shaderc nxtcpp nxt)
|
target_link_libraries(utils nxt_backend shaderc_shared nxtcpp nxt)
|
||||||
target_include_directories(utils PUBLIC ${SRC_DIR})
|
target_include_directories(utils PUBLIC ${SRC_DIR})
|
||||||
NXTInternalTarget("" utils)
|
NXTInternalTarget("" utils)
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
|
|
|
@ -44,6 +44,14 @@ NXTExternalTarget("third_party" glad)
|
||||||
set(SPIRV_WERROR OFF CACHE BOOL "" FORCE)
|
set(SPIRV_WERROR OFF CACHE BOOL "" FORCE)
|
||||||
# Don't add unnecessary shaderc targets
|
# Don't add unnecessary shaderc targets
|
||||||
set(SHADERC_SKIP_TESTS ON)
|
set(SHADERC_SKIP_TESTS ON)
|
||||||
|
set(SHADERC_SKIP_INSTALL ON)
|
||||||
|
# Remove unused glslang and spirv-tools parts
|
||||||
|
# set(ENABLE_HLSL OFF CACHE BOOL "")
|
||||||
|
set(ENABLE_OPT OFF CACHE BOOL "")
|
||||||
|
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
|
||||||
|
set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
|
||||||
|
set(SKIP_SPIRV_TOOLS_INSTALL ON CACHE BOOL "")
|
||||||
|
set(SPIRV_SKIP_EXECUTABLES ON CACHE BOOL "")
|
||||||
# Help shaderc find the non-standard paths for its dependencies
|
# Help shaderc find the non-standard paths for its dependencies
|
||||||
set(SHADERC_GOOGLE_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest CACHE STRING "Location of googletest source")
|
set(SHADERC_GOOGLE_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest CACHE STRING "Location of googletest source")
|
||||||
set(SHADERC_GLSLANG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/glslang" CACHE STRING "Location of glslang source")
|
set(SHADERC_GLSLANG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/glslang" CACHE STRING "Location of glslang source")
|
||||||
|
@ -64,6 +72,7 @@ set_target_properties(
|
||||||
glslc_exe
|
glslc_exe
|
||||||
install-headers
|
install-headers
|
||||||
shaderc
|
shaderc
|
||||||
|
shaderc_shared
|
||||||
shaderc_util
|
shaderc_util
|
||||||
shaderc_combined_genfile
|
shaderc_combined_genfile
|
||||||
shaderc-online-compile testdata
|
shaderc-online-compile testdata
|
||||||
|
@ -71,6 +80,18 @@ set_target_properties(
|
||||||
SPIRV-Headers-example-1.1
|
SPIRV-Headers-example-1.1
|
||||||
PROPERTIES FOLDER "third_party/shaderc"
|
PROPERTIES FOLDER "third_party/shaderc"
|
||||||
)
|
)
|
||||||
|
# Remove a bunch of targets we don't need that are pulled by shaderc and glslang
|
||||||
|
set_target_properties(
|
||||||
|
SPIRV-Headers-example-1.1
|
||||||
|
SPIRV-Headers-example
|
||||||
|
glslc_exe
|
||||||
|
SPIRV-Tools-link
|
||||||
|
SPVRemapper
|
||||||
|
shaderc
|
||||||
|
shaderc-online-compile
|
||||||
|
shaderc_combined_genfile
|
||||||
|
PROPERTIES EXCLUDE_FROM_ALL true
|
||||||
|
)
|
||||||
|
|
||||||
# SPIRV-Cross
|
# SPIRV-Cross
|
||||||
set(SPIRV_CROSS_SOURCES
|
set(SPIRV_CROSS_SOURCES
|
||||||
|
|
Loading…
Reference in New Issue