• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1add_library(glslang-default-resource-limits
2            ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp)
3set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
4set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
5
6target_include_directories(glslang-default-resource-limits
7                           PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
8                           PUBLIC ${PROJECT_SOURCE_DIR})
9
10set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
11set(REMAPPER_SOURCES spirv-remap.cpp)
12
13add_executable(glslangValidator ${SOURCES})
14add_executable(spirv-remap ${REMAPPER_SOURCES})
15set_property(TARGET glslangValidator PROPERTY FOLDER tools)
16set_property(TARGET spirv-remap PROPERTY FOLDER tools)
17glslang_set_link_args(glslangValidator)
18glslang_set_link_args(spirv-remap)
19
20set(LIBRARIES
21    glslang
22    SPIRV
23    SPVRemapper
24    glslang-default-resource-limits)
25
26if(WIN32)
27    set(LIBRARIES ${LIBRARIES} psapi)
28elseif(UNIX)
29    if(NOT ANDROID)
30        set(LIBRARIES ${LIBRARIES} pthread)
31    endif()
32endif(WIN32)
33
34target_link_libraries(glslangValidator ${LIBRARIES})
35target_link_libraries(spirv-remap ${LIBRARIES})
36target_include_directories(glslangValidator PUBLIC ../External)
37
38if(WIN32)
39    source_group("Source" FILES ${SOURCES})
40endif(WIN32)
41
42if(ENABLE_GLSLANG_INSTALL)
43    install(TARGETS glslangValidator
44            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
45
46    install(TARGETS spirv-remap
47            RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
48
49    if(BUILD_SHARED_LIBS)
50        install(TARGETS glslang-default-resource-limits
51                LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
52    endif()
53endif(ENABLE_GLSLANG_INSTALL)
54