Skip to content

Commit 1f5193e

Browse files
lukaszgotszaldintelsys_zuul
authored andcommitted
We compile SPIRV-Headers project and SPIRV-Tools project together in a single Visual Studio solution. Code of those are on external, open source repository. Sometimes we are witnesses of a random build break during SPIRV-Headers installation. We want to skip the installation process not only to avoid this issue, but also because we do not need it. I have added new CMake option SPIRV_HEADERS_SKIP_INSTALL to avoid installing SPIRV-Headers: KhronosGroup/SPIRV-Headers#131. However, recently SPIRV-Headers library has become an INTERFACE library. In the same time SPIRV-Tools sets property FOLDER quite often. This combination is not allowed by CMake. I have proposed another change to fix this conflict between libraries: KhronosGroup/SPIRV-Headers#132. But we do not need to compile SPIRV-Headers library at all. We just need to include its headers. So, finally I have decided to comment out instruction add_subdirectory for SPIRV-Headers.
Change-Id: I499bbddca76129bdc7061be43a599c1b16cf01e6
1 parent e31699d commit 1f5193e

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

IGC/CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3433,14 +3433,18 @@ if(IGC_BUILD__SPIRV-Tools)
34333433
option(SKIP_SPIRV_TOOLS_INSTALL "Skip SPIRV-Tools installation" ON)
34343434
option(SPIRV_SKIP_TESTS "Skip building SPIRV-Tools tests along with the library" ON)
34353435
option(SPIRV_SKIP_EXECUTABLES "Skip building SPIRV-Tools executables and tests along with the library" ON)
3436-
message(STATUS "SPIRV-Tools source directory: ${IGC_BUILD__SPIRV-Tools_DIR}")
3437-
message(STATUS "SPIRV-Headers source directory: ${IGC_BUILD__SPIRV-Headers_DIR}")
3438-
message(STATUS "SPIRV-Tools output directory: ${IGC_BUILD__SPIRV-Tools_OUTPUT_DIR}")
3439-
message(STATUS "SPIRV-Headers output directory: ${IGC_BUILD__SPIRV-Headers_OUTPUT_DIR}")
3436+
option(SPIRV_HEADERS_SKIP_INSTALL "Skip SPIRV-Headers installation" ON)
3437+
option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building SPIRV-Headers examples" ON)
3438+
message(STATUS "SPIRV-Tools source directory: ${IGC_BUILD__SPIRV-Tools_DIR}")
3439+
message(STATUS "SPIRV-Headers source directory: ${IGC_BUILD__SPIRV-Headers_DIR}")
3440+
message(STATUS "SPIRV-Tools output directory: ${IGC_BUILD__SPIRV-Tools_OUTPUT_DIR}")
3441+
message(STATUS "SPIRV-Headers output directory: ${IGC_BUILD__SPIRV-Headers_OUTPUT_DIR}")
34403442
message(STATUS "Option SKIP_SPIRV_TOOLS_INSTALL: ${SKIP_SPIRV_TOOLS_INSTALL}")
3441-
message(STATUS "Option SPIRV_SKIP_TESTS: ${SPIRV_SKIP_TESTS}")
3442-
message(STATUS "Option SPIRV_SKIP_EXECUTABLES: ${SPIRV_SKIP_EXECUTABLES}")
3443-
add_subdirectory("${IGC_BUILD__SPIRV-Headers_DIR}" "${IGC_BUILD__SPIRV-Headers_OUTPUT_DIR}")
3443+
message(STATUS "Option SPIRV_SKIP_TESTS: ${SPIRV_SKIP_TESTS}")
3444+
message(STATUS "Option SPIRV_SKIP_EXECUTABLES: ${SPIRV_SKIP_EXECUTABLES}")
3445+
message(STATUS "Option SPIRV_HEADERS_SKIP_INSTALL: ${SPIRV_HEADERS_SKIP_INSTALL}")
3446+
message(STATUS "Option SPIRV_HEADERS_SKIP_EXAMPLES: ${SPIRV_HEADERS_SKIP_EXAMPLES}")
3447+
# add_subdirectory("${IGC_BUILD__SPIRV-Headers_DIR}" "${IGC_BUILD__SPIRV-Headers_OUTPUT_DIR}")
34443448
add_subdirectory("${IGC_BUILD__SPIRV-Tools_DIR}" "${IGC_BUILD__SPIRV-Tools_OUTPUT_DIR}")
34453449
set(IGC_BUILD__PROJ__SPIRV-Tools "SPIRV-Tools")
34463450
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS IGC_BUILD_SPIRV_TOOLS)
@@ -3450,6 +3454,8 @@ if(IGC_BUILD__SPIRV-Tools)
34503454
unset(SKIP_SPIRV_TOOLS_INSTALL)
34513455
unset(SPIRV_SKIP_TESTS)
34523456
unset(SPIRV_SKIP_EXECUTABLES)
3457+
unset(SPIRV_HEADERS_SKIP_INSTALL)
3458+
unset(SPIRV_HEADERS_SKIP_EXAMPLES)
34533459
include_directories("${IGC_BUILD__SPIRV-Headers_DIR}/include")
34543460
include_directories("${IGC_BUILD__SPIRV-Tools_DIR}/include")
34553461
message(STATUS "=============================================================================")

0 commit comments

Comments
 (0)