Merge remote-tracking branch 'upstream/master'
[platform/upstream/glslang.git] / StandAlone / CMakeLists.txt
1 add_library(glslang-default-resource-limits
2     ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp
3 )
4 set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
5
6 target_include_directories(glslang-default-resource-limits
7     PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
8     PUBLIC ${PROJECT_SOURCE_DIR}
9 )
10
11 set(SOURCES StandAlone.cpp)
12 set(REMAPPER_SOURCES spirv-remap.cpp)
13
14 add_executable(glslangValidator ${SOURCES})
15 add_executable(spirv-remap ${REMAPPER_SOURCES})
16 set_property(TARGET glslangValidator PROPERTY FOLDER tools)
17 set_property(TARGET spirv-remap PROPERTY FOLDER tools)
18 glslang_set_link_args(glslangValidator)
19 glslang_set_link_args(spirv-remap)
20
21 set(LIBRARIES
22     glslang
23     OGLCompiler
24     OSDependent
25     HLSL
26     SPIRV
27     glslang-default-resource-limits)
28
29 if(WIN32)
30     set(LIBRARIES ${LIBRARIES} psapi)
31 elseif(UNIX)
32     if(NOT ANDROID)
33         set(LIBRARIES ${LIBRARIES} pthread)
34     endif()
35 endif(WIN32)
36
37 target_link_libraries(glslangValidator ${LIBRARIES})
38 target_link_libraries(spirv-remap ${LIBRARIES})
39
40 if(WIN32)
41     source_group("Source" FILES ${SOURCES})
42 endif(WIN32)
43
44 install(TARGETS glslangValidator
45         RUNTIME DESTINATION bin)
46
47 install(TARGETS spirv-remap
48         RUNTIME DESTINATION bin)