Skip to content

Commit 3a44d5d

Browse files
committed
When glslc is not built, don't install or test it
Fix the logic when SHADERC_SKIP_EXECUTABLES=ON * Don't try to install the glslc executable * Don't try to run tests that invoke glslc
1 parent 1dd61a4 commit 3a44d5d

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

glslc/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ shaderc_add_tests(
6868
shaderc_add_asciidoc(glslc_doc_README README)
6969

7070
if(SHADERC_ENABLE_INSTALL)
71-
install(TARGETS glslc_exe
72-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
73-
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
71+
if(SHADERC_ENABLE_EXECUTABLES)
72+
install(TARGETS glslc_exe
73+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
74+
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
75+
endif(SHADERC_ENABLE_EXECUTABLES)
7476
endif(SHADERC_ENABLE_INSTALL)
7577

7678
add_subdirectory(test)

glslc/test/CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ if(${SHADERC_ENABLE_TESTS})
2121
COMMAND ${Python_EXECUTABLE} -m unittest glslc_test_framework_unittest.py
2222
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
2323

24-
add_test(NAME glslc_tests
25-
COMMAND ${Python_EXECUTABLE}
26-
${CMAKE_CURRENT_SOURCE_DIR}/glslc_test_framework.py
27-
$<TARGET_FILE:glslc_exe> $<TARGET_FILE:spirv-dis>
28-
--test-dir ${CMAKE_CURRENT_SOURCE_DIR})
29-
24+
# These tests use the glslc executable, so they can only run if
25+
# glslc has been built.
26+
if(${SHADERC_ENABLE_EXECUTABLES})
27+
add_test(NAME glslc_tests
28+
COMMAND ${Python_EXECUTABLE}
29+
${CMAKE_CURRENT_SOURCE_DIR}/glslc_test_framework.py
30+
$<TARGET_FILE:glslc_exe> $<TARGET_FILE:spirv-dis>
31+
--test-dir ${CMAKE_CURRENT_SOURCE_DIR})
32+
endif()
33+
3034
endif()

0 commit comments

Comments
 (0)