From 105926e51e60aecaa70f7ba123c70fa0d1a76b88 Mon Sep 17 00:00:00 2001 From: freiro Date: Tue, 29 Nov 2016 20:32:31 +0100 Subject: [PATCH] Fixing cmake to support clang-cl --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c9b7f86a..026d51c80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,8 +62,12 @@ if (NOT DEFINED ARCHITECTURE) endif() message(STATUS "Target architecture: ${ARCHITECTURE}") -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +IF (WIN32 AND (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")) + set(CMAKE_CXX_FLAGS "-Xclang -std=c++14")# -Qunused-arguments -Xclang -Wno-missing-braces ") +ELSE() + set(CMAKE_CXX_STANDARD 14) + set(CMAKE_CXX_STANDARD_REQUIRED ON) +ENDIF() if (NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") @@ -98,7 +102,7 @@ else() # /Zo - enahnced debug info for optimized builds set(CMAKE_C_FLAGS "/W3 /MP /Zi /Zo" CACHE STRING "" FORCE) # /EHsc - C++-only exception handling semantics - set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /EHsc" CACHE STRING "" FORCE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} /EHsc" CACHE STRING "" FORCE) # /MDd - Multi-threaded Debug Runtime DLL set(CMAKE_C_FLAGS_DEBUG "/Od /MDd" CACHE STRING "" FORCE)