Remove gcc-specific flags from Visual Studio build
authorMichael Kruse <llvm@meinersbur.de>
Tue, 21 Jul 2015 12:22:36 +0000 (12:22 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Tue, 21 Jul 2015 12:22:36 +0000 (12:22 +0000)
Remove the flags -fno-exceptions -fno-rtti and add the equivalent for
compiling with MSVC.

Reviewers: grosser
llvm-svn: 242775

polly/CMakeLists.txt

index 5c0270e..64c671e 100644 (file)
@@ -75,10 +75,13 @@ if (CMAKE_COMPILER_IS_GNUCXX)
   # FIXME: Turn off exceptions, RTTI:
   # -fno-exceptions -fno-rtti
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti")
+elseif (MSVC)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-")
+  add_definitions("-D_HAS_EXCEPTIONS=0")
+else ()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
 endif ()
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
-
 # Define the FLAGS for the compilation of isl and imath
 #
 # Those are the only C files we have in the repository. Hence, we can just use