2016-06-26 05:06:20 +00:00
|
|
|
add_library(glslang-default-resource-limits
|
2018-06-02 07:26:43 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp)
|
2016-06-26 05:06:20 +00:00
|
|
|
set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
|
2018-06-02 07:26:43 +00:00
|
|
|
set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
|
2016-06-26 05:06:20 +00:00
|
|
|
|
|
|
|
target_include_directories(glslang-default-resource-limits
|
2020-03-02 15:42:00 +00:00
|
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
|
|
|
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
|
|
|
|
|
2016-06-26 05:06:20 +00:00
|
|
|
|
2018-06-02 07:26:43 +00:00
|
|
|
set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
|
2016-06-26 05:06:20 +00:00
|
|
|
|
|
|
|
add_executable(glslangValidator ${SOURCES})
|
|
|
|
set_property(TARGET glslangValidator PROPERTY FOLDER tools)
|
|
|
|
glslang_set_link_args(glslangValidator)
|
|
|
|
|
|
|
|
set(LIBRARIES
|
|
|
|
glslang
|
|
|
|
SPIRV
|
|
|
|
glslang-default-resource-limits)
|
|
|
|
|
2020-03-02 15:42:00 +00:00
|
|
|
if(ENABLE_SPVREMAPPER)
|
|
|
|
set(LIBRARIES ${LIBRARIES} SPVRemapper)
|
|
|
|
endif()
|
|
|
|
|
2016-06-26 05:06:20 +00:00
|
|
|
if(WIN32)
|
|
|
|
set(LIBRARIES ${LIBRARIES} psapi)
|
|
|
|
elseif(UNIX)
|
|
|
|
if(NOT ANDROID)
|
|
|
|
set(LIBRARIES ${LIBRARIES} pthread)
|
|
|
|
endif()
|
|
|
|
endif(WIN32)
|
|
|
|
|
|
|
|
target_link_libraries(glslangValidator ${LIBRARIES})
|
2020-03-02 15:42:00 +00:00
|
|
|
target_include_directories(glslangValidator PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
|
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
|
|
|
|
|
|
|
|
if(ENABLE_SPVREMAPPER)
|
|
|
|
set(REMAPPER_SOURCES spirv-remap.cpp)
|
|
|
|
add_executable(spirv-remap ${REMAPPER_SOURCES})
|
|
|
|
set_property(TARGET spirv-remap PROPERTY FOLDER tools)
|
|
|
|
glslang_set_link_args(spirv-remap)
|
|
|
|
target_link_libraries(spirv-remap ${LIBRARIES})
|
|
|
|
endif()
|
2016-06-26 05:06:20 +00:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
source_group("Source" FILES ${SOURCES})
|
|
|
|
endif(WIN32)
|
|
|
|
|
2018-06-02 07:26:43 +00:00
|
|
|
if(ENABLE_GLSLANG_INSTALL)
|
2020-03-02 15:42:00 +00:00
|
|
|
install(TARGETS glslangValidator EXPORT glslangValidatorTargets
|
2018-06-02 07:26:43 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2020-03-02 15:42:00 +00:00
|
|
|
install(EXPORT glslangValidatorTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
2016-06-26 05:06:20 +00:00
|
|
|
|
2020-03-02 15:42:00 +00:00
|
|
|
if(ENABLE_SPVREMAPPER)
|
|
|
|
install(TARGETS spirv-remap EXPORT spirv-remapTargets
|
2018-06-02 07:26:43 +00:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2020-03-02 15:42:00 +00:00
|
|
|
install(EXPORT spirv-remapTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
|
|
|
endif()
|
|
|
|
|
2018-06-02 07:26:43 +00:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2020-03-02 15:42:00 +00:00
|
|
|
install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets
|
2018-06-02 07:26:43 +00:00
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2020-03-02 15:42:00 +00:00
|
|
|
install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
|
2018-06-02 07:26:43 +00:00
|
|
|
endif()
|
|
|
|
endif(ENABLE_GLSLANG_INSTALL)
|