diff options
Diffstat (limited to 'CompileFlags.cmake')
-rw-r--r-- | CompileFlags.cmake | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake index c231ede..91f2adf 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -8,11 +8,16 @@ if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Intel") set(_INTEL_WINDOWS 1) endif() +if(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "Clang" + AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + set(_CLANG_MSVC_WINDOWS 1) +endif() + # Disable deprecation warnings for standard C functions. # really only needed for newer versions of VS, but should # not hurt other versions, and this will work into the # future -if(MSVC OR _INTEL_WINDOWS) +if(MSVC OR _INTEL_WINDOWS OR _CLANG_MSVC_WINDOWS) add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) else() endif() @@ -21,9 +26,7 @@ if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000") endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL Clang - AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" - AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") +if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000") endif() |