if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
+if(POLICY CMP0054)
+ cmake_policy(SET CMP0054 NEW)
+endif()
project(glslang LANGUAGES CXX)
if(WIN32)
set(CMAKE_DEBUG_POSTFIX "d")
- if(MSVC)
+ option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON)
+ if(MSVC AND OVERRIDE_MSVCCRT)
include(ChooseMSVCCRT.cmake)
endif(MSVC)
add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
if(ENABLE_EXCEPTIONS)
add_compile_options(/EHsc) # Enable Exceptions
else()
- string(REGEX REPLACE /EHsc "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Try to remove default /EHsc cxx_flag
- add_compile_definitions(_HAS_EXCEPTIONS=0)
+ string(REGEX REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Try to remove default /EHsc cxx_flag
+ add_compile_options(/D_HAS_EXCEPTIONS=0)
endif()
endif()