Add tessellation shader tests (ported from ES 3.1)
[platform/upstream/VK-GL-CTS.git] / external / glslang / CMakeLists.txt
1 # cmake file for glslang
2
3 if (NOT DE_DEFS)
4         message(FATAL_ERROR "Include Defs.cmake")
5 endif ()
6
7 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/SPIRV/GlslangToSpv.cpp")
8         set(DEFAULT_GLSLANG_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src)
9 else ()
10         set(DEFAULT_GLSLANG_SRC_PATH "../glslang")
11 endif ()
12
13 set(GLSLANG_SRC_PATH ${DEFAULT_GLSLANG_SRC_PATH} CACHE STRING "Path to glslang source tree")
14
15 if (IS_ABSOLUTE ${GLSLANG_SRC_PATH})
16         set(GLSLANG_ABS_PATH ${GLSLANG_SRC_PATH})
17 else ()
18         set(GLSLANG_ABS_PATH "${CMAKE_SOURCE_DIR}/${GLSLANG_SRC_PATH}")
19 endif ()
20
21 if (EXISTS ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen/CodeGen.cpp)
22         message(STATUS "glslang found; building with DEQP_SUPPORT_GLSLANG")
23
24         include_directories(
25                 ${GLSLANG_ABS_PATH}
26                 ${GLSLANG_ABS_PATH}/glslang
27                 ${GLSLANG_ABS_PATH}/glslang/Include
28                 ${GLSLANG_ABS_PATH}/glslang/Public
29                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent
30                 ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen
31                 ${GLSLANG_ABS_PATH}/glslang/OSDependent
32                 ${GLSLANG_ABS_PATH}/hlsl
33                 ${GLSLANG_ABS_PATH}/OGLCompilersDLL
34                 ${GLSLANG_ABS_PATH}/SPIRV
35                 )
36
37         set(GLSLANG_SRCS
38                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/Constant.cpp
39                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/InfoSink.cpp
40                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/Initialize.cpp
41                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/IntermTraverse.cpp
42                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/Intermediate.cpp
43                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/ParseHelper.cpp
44                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/PoolAlloc.cpp
45                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/RemoveTree.cpp
46                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/Scan.cpp
47                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/ShaderLang.cpp
48                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/SymbolTable.cpp
49                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/Versions.cpp
50                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/glslang_tab.cpp
51                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/intermOut.cpp
52                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/limits.cpp
53                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/linkValidate.cpp
54                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/parseConst.cpp
55                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/propagateNoContraction.cpp
56                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/reflection.cpp
57                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/Pp.cpp
58                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/PpAtom.cpp
59                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/PpContext.cpp
60                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/PpMemory.cpp
61                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/PpScanner.cpp
62                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/PpSymbols.cpp
63                 ${GLSLANG_ABS_PATH}/glslang/MachineIndependent/preprocessor/PpTokens.cpp
64                 ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen/CodeGen.cpp
65                 ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen/Link.cpp
66                 ${GLSLANG_ABS_PATH}/OGLCompilersDLL/InitializeDll.cpp
67
68                 ${GLSLANG_ABS_PATH}/hlsl/hlslGrammar.cpp
69                 ${GLSLANG_ABS_PATH}/hlsl/hlslOpMap.cpp
70                 ${GLSLANG_ABS_PATH}/hlsl/hlslParseHelper.cpp
71                 ${GLSLANG_ABS_PATH}/hlsl/hlslScanContext.cpp
72                 ${GLSLANG_ABS_PATH}/hlsl/hlslTokenStream.cpp
73
74                 ${GLSLANG_ABS_PATH}/SPIRV/GlslangToSpv.cpp
75                 ${GLSLANG_ABS_PATH}/SPIRV/InReadableOrder.cpp
76                 ${GLSLANG_ABS_PATH}/SPIRV/SpvBuilder.cpp
77                 ${GLSLANG_ABS_PATH}/SPIRV/SPVRemapper.cpp
78                 ${GLSLANG_ABS_PATH}/SPIRV/Logger.cpp
79                 ${GLSLANG_ABS_PATH}/SPIRV/doc.cpp
80                 ${GLSLANG_ABS_PATH}/SPIRV/disassemble.cpp
81
82                 osinclude.cpp
83                 )
84
85         set(CMAKE_C_FLAGS       ${DE_3RD_PARTY_C_FLAGS})
86         set(CMAKE_CXX_FLAGS     ${DE_3RD_PARTY_CXX_FLAGS})
87
88         if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
89                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
90         endif ()
91
92         add_library(glslang STATIC ${GLSLANG_SRCS})
93         target_link_libraries(glslang dethread ${ZLIB_LIBRARY})
94
95         set(GLSLANG_INCLUDE_PATH        ${GLSLANG_ABS_PATH}     PARENT_SCOPE)
96         set(GLSLANG_LIBRARY                     glslang                         PARENT_SCOPE)
97         set(DEQP_HAVE_GLSLANG           ON                                      PARENT_SCOPE)
98
99 else ()
100         message(STATUS "glslang not found; GLSL to SPIR-V compilation not available")
101
102         set(DEQP_HAVE_GLSLANG           OFF                                     PARENT_SCOPE)
103
104 endif ()