bgfx/3rdparty/glslang/SPIRV/CMakeLists.txt

102 lines
2.7 KiB
CMake
Raw Normal View History

2016-12-16 01:19:54 +03:00
set(SOURCES
GlslangToSpv.cpp
InReadableOrder.cpp
Logger.cpp
SpvBuilder.cpp
2018-08-18 07:20:54 +03:00
SpvPostProcess.cpp
2016-12-16 01:19:54 +03:00
doc.cpp
2018-09-03 07:14:20 +03:00
SpvTools.cpp
2016-12-16 01:19:54 +03:00
disassemble.cpp)
set(SPVREMAP_SOURCES
SPVRemapper.cpp
doc.cpp)
set(HEADERS
bitutils.h
spirv.hpp
GLSL.std.450.h
2018-03-03 22:26:07 +03:00
GLSL.ext.EXT.h
2016-12-16 01:19:54 +03:00
GLSL.ext.KHR.h
GlslangToSpv.h
hex_float.h
Logger.h
SpvBuilder.h
spvIR.h
doc.h
2018-09-03 07:14:20 +03:00
SpvTools.h
2016-12-16 01:19:54 +03:00
disassemble.h)
set(SPVREMAP_HEADERS
SPVRemapper.h
doc.h)
if(ENABLE_AMD_EXTENSIONS)
list(APPEND
HEADERS
GLSL.ext.AMD.h)
endif(ENABLE_AMD_EXTENSIONS)
2016-12-22 09:59:02 +03:00
if(ENABLE_NV_EXTENSIONS)
2017-01-25 21:07:49 +03:00
list(APPEND
HEADERS
GLSL.ext.NV.h)
2016-12-22 09:59:02 +03:00
endif(ENABLE_NV_EXTENSIONS)
2018-04-14 05:31:28 +03:00
add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS})
2017-07-08 07:19:36 +03:00
set_property(TARGET SPIRV PROPERTY FOLDER glslang)
set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON)
2018-06-10 03:15:06 +03:00
target_include_directories(SPIRV PUBLIC ..)
2016-12-16 01:19:54 +03:00
2018-07-21 04:19:21 +03:00
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()
2016-12-16 01:19:54 +03:00
2018-04-14 05:31:28 +03:00
if(WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(SPIRV PROPERTIES PREFIX "")
2018-07-21 04:19:21 +03:00
if (ENABLE_SPVREMAPPER)
set_target_properties(SPVRemapper PROPERTIES PREFIX "")
endif()
2018-04-14 05:31:28 +03:00
endif()
2017-09-23 08:36:46 +03:00
if(ENABLE_OPT)
target_include_directories(SPIRV
PRIVATE ${spirv-tools_SOURCE_DIR}/include
PRIVATE ${spirv-tools_SOURCE_DIR}/source
)
2018-04-01 18:45:28 +03:00
target_link_libraries(SPIRV glslang SPIRV-Tools-opt)
2018-07-08 01:52:49 +03:00
target_include_directories(SPIRV PUBLIC ../External)
2017-09-23 08:36:46 +03:00
else()
target_link_libraries(SPIRV glslang)
endif(ENABLE_OPT)
2016-12-16 01:19:54 +03:00
if(WIN32)
source_group("Source" FILES ${SOURCES} ${HEADERS})
source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
endif(WIN32)
2017-07-08 07:19:36 +03:00
if(ENABLE_GLSLANG_INSTALL)
2018-05-05 05:56:50 +03:00
if(BUILD_SHARED_LIBS)
2018-07-21 04:19:21 +03:00
if (ENABLE_SPVREMAPPER)
install(TARGETS SPVRemapper
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(TARGETS SPIRV
2018-05-05 05:56:50 +03:00
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
2019-06-07 08:11:01 +03:00
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
2018-05-05 05:56:50 +03:00
else()
2018-07-21 04:19:21 +03:00
if (ENABLE_SPVREMAPPER)
install(TARGETS SPVRemapper
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(TARGETS SPIRV
2018-05-05 05:56:50 +03:00
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
2017-02-04 06:32:35 +03:00
2017-07-08 07:19:36 +03:00
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
endif(ENABLE_GLSLANG_INSTALL)