1 cmake_minimum_required(VERSION 2.8.11)
2 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
4 option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
5 option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
7 option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
9 option(ENABLE_HLSL "Enables HLSL input support" ON)
13 set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix")
17 if(ENABLE_AMD_EXTENSIONS)
18 add_definitions(-DAMD_EXTENSIONS)
19 endif(ENABLE_AMD_EXTENSIONS)
21 if(ENABLE_NV_EXTENSIONS)
22 add_definitions(-DNV_EXTENSIONS)
23 endif(ENABLE_NV_EXTENSIONS)
26 add_definitions(-DENABLE_HLSL)
30 set(CMAKE_DEBUG_POSTFIX "d")
32 include(ChooseMSVCCRT.cmake)
34 add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
36 add_definitions(-fPIC)
37 add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
39 message("unknown platform")
42 if(CMAKE_COMPILER_IS_GNUCXX)
43 add_definitions(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
44 -Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable)
45 add_definitions(-Wno-reorder) # disable this from -Wall, since it happens all over.
46 add_definitions(-std=c++11)
47 elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
48 add_definitions(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs
49 -Wunused-parameter -Wunused-value -Wunused-variable)
50 add_definitions(-Wno-reorder) # disable this from -Wall, since it happens all over.
51 add_definitions(-std=c++11)
54 function(glslang_set_link_args TARGET)
55 # For MinGW compiles, statically link against the GCC and C++ runtimes.
56 # This avoids the need to ship those runtimes as DLLs.
58 if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
59 set_target_properties(${TARGET} PROPERTIES
60 LINK_FLAGS "-static -static-libgcc -static-libstdc++")
63 endfunction(glslang_set_link_args)
65 # We depend on these for later projects, so they should come first.
66 add_subdirectory(External)
68 add_subdirectory(glslang)
69 add_subdirectory(OGLCompilersDLL)
70 if(ENABLE_GLSLANG_BINARIES)
71 add_subdirectory(StandAlone)
73 add_subdirectory(SPIRV)
75 add_subdirectory(hlsl)
77 add_subdirectory(gtests)