Check for ENABLE_SPVREMAPPER flag in CMakeList files.

There is a flag to disable the SPVRemapper during the GLSLang build.
That flag is check in some, but not all spots so if you try to build
with SPVRemapper disabled you get CMake errors and compile errors.

This CL fixs up the build so building with -DENABLE_SPVREMAPPER=0 will
complete correclty.
This commit is contained in:
Dan Sinclair
2019-11-21 10:33:32 -05:00
parent f4d4668529
commit 04567eb232
3 changed files with 35 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ set(SPVREMAP_HEADERS
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(SPIRV PUBLIC
target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
@@ -91,7 +91,10 @@ if(ENABLE_GLSLANG_INSTALL)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(EXPORT SPVRemapperTargets DESTINATION lib/cmake)
if (ENABLE_SPVREMAPPER)
install(EXPORT SPVRemapperTargets DESTINATION lib/cmake)
endif()
install(EXPORT SPIRVTargets DESTINATION lib/cmake)
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)