Add support for SPV_NV_sample_mask_override_coverage
[platform/upstream/glslang.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8.11)
2 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
3
4 option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
5
6 option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
7
8 enable_testing()
9
10 set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix")
11
12 project(glslang)
13
14 if(ENABLE_AMD_EXTENSIONS)
15     add_definitions(-DAMD_EXTENSIONS)
16 endif(ENABLE_AMD_EXTENSIONS)
17
18 if(ENABLE_NV_EXTENSIONS)
19     add_definitions(-DNV_EXTENSIONS)
20 endif(ENABLE_NV_EXTENSIONS)
21
22 if(WIN32)
23     set(CMAKE_DEBUG_POSTFIX "d")
24     include(ChooseMSVCCRT.cmake)
25     add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
26 elseif(UNIX)
27     add_definitions(-fPIC)
28     add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
29 else(WIN32)
30     message("unknown platform")
31 endif(WIN32)
32
33 if(CMAKE_COMPILER_IS_GNUCXX)
34     add_definitions(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
35       -Wunused-parameter -Wunused-value  -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable)
36     add_definitions(-Wno-reorder)  # disable this from -Wall, since it happens all over.
37     add_definitions(-std=c++11)
38 elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
39     add_definitions(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
40       -Wunused-parameter -Wunused-value  -Wunused-variable)
41     add_definitions(-Wno-reorder)  # disable this from -Wall, since it happens all over.
42     add_definitions(-std=c++11)
43 endif()
44
45 function(glslang_set_link_args TARGET)
46     # For MinGW compiles, statically link against the GCC and C++ runtimes.
47     # This avoids the need to ship those runtimes as DLLs.
48     if(WIN32)
49         if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
50             set_target_properties(${TARGET} PROPERTIES
51                     LINK_FLAGS "-static -static-libgcc -static-libstdc++")
52         endif()
53     endif(WIN32)
54 endfunction(glslang_set_link_args)
55
56 # We depend on these for later projects, so they should come first.
57 add_subdirectory(External)
58
59 add_subdirectory(glslang)
60 add_subdirectory(OGLCompilersDLL)
61 add_subdirectory(StandAlone)
62 add_subdirectory(SPIRV)
63 add_subdirectory(hlsl)
64 add_subdirectory(gtests)