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)
6 option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
10 set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix")
14 if(ENABLE_AMD_EXTENSIONS)
15 add_definitions(-DAMD_EXTENSIONS)
16 endif(ENABLE_AMD_EXTENSIONS)
18 if(ENABLE_NV_EXTENSIONS)
19 add_definitions(-DNV_EXTENSIONS)
20 endif(ENABLE_NV_EXTENSIONS)
23 set(CMAKE_DEBUG_POSTFIX "d")
24 include(ChooseMSVCCRT.cmake)
25 add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
27 add_definitions(-fPIC)
28 add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
30 message("unknown platform")
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)
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.
49 if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
50 set_target_properties(${TARGET} PROPERTIES
51 LINK_FLAGS "-static -static-libgcc -static-libstdc++")
54 endfunction(glslang_set_link_args)
56 # We depend on these for later projects, so they should come first.
57 add_subdirectory(External)
59 add_subdirectory(glslang)
60 add_subdirectory(OGLCompilersDLL)
61 add_subdirectory(StandAlone)
62 add_subdirectory(SPIRV)
63 add_subdirectory(hlsl)
64 add_subdirectory(gtests)