diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a869c2c00110bf23e953125d1c6c77fad7656bc..c99bedf389d1cfc6baa74ff8fa95be3ba39f23ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL}) if(NOT ${SKIP_GLSLANG_INSTALL}) set(ENABLE_GLSLANG_INSTALL ON) endif() +option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON) option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON) option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON) @@ -52,7 +53,7 @@ if(ENABLE_HLSL) endif(ENABLE_HLSL) if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d") + set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Adds a postfix for debug-built libraries.") if(MSVC) include(ChooseMSVCCRT.cmake) endif(MSVC) diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index bf2be167e7ea86e571f09aef5f87a16e6e2060c9..be58d021bcfc2365fe26ac3f9193b9a5ef571f61 100755 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -45,13 +45,17 @@ set_property(TARGET SPIRV PROPERTY FOLDER glslang) set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) target_include_directories(SPIRV PUBLIC ..) -add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) -set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) -set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) +if (ENABLE_SPVREMAPPER) + add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) + set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) + set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) +endif() if(WIN32 AND BUILD_SHARED_LIBS) set_target_properties(SPIRV PROPERTIES PREFIX "") - set_target_properties(SPVRemapper PROPERTIES PREFIX "") + if (ENABLE_SPVREMAPPER) + set_target_properties(SPVRemapper PROPERTIES PREFIX "") + endif() endif() if(ENABLE_OPT) @@ -72,11 +76,20 @@ endif(WIN32) if(ENABLE_GLSLANG_INSTALL) if(BUILD_SHARED_LIBS) - install(TARGETS SPIRV SPVRemapper + if (ENABLE_SPVREMAPPER) + install(TARGETS SPVRemapper + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + install(TARGETS SPIRV ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) else() - install(TARGETS SPIRV SPVRemapper + if (ENABLE_SPVREMAPPER) + install(TARGETS SPVRemapper + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + endif() + install(TARGETS SPIRV ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif()