aboutsummaryrefslogtreecommitdiff
path: root/cmake/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/compiler')
-rw-r--r--cmake/compiler/clang/settings.cmake15
-rw-r--r--cmake/compiler/gcc/settings.cmake20
-rw-r--r--cmake/compiler/icc/settings.cmake5
-rw-r--r--cmake/compiler/xcode/settings.cmake2
4 files changed, 26 insertions, 16 deletions
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake
new file mode 100644
index 00000000000..ae07b1fc39b
--- /dev/null
+++ b/cmake/compiler/clang/settings.cmake
@@ -0,0 +1,15 @@
+# Set build-directive (used in core to tell which buildtype we used)
+add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
+
+if(WITH_WARNINGS)
+ set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Wfatal-errors")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
+ message(STATUS "Clang: All warnings enabled")
+endif()
+
+if(WITH_COREDEBUG)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
+ message(STATUS "Clang: Debug-flags set (-g3)")
+endif()
diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake
index 8247831fdd8..25ee96c8562 100644
--- a/cmake/compiler/gcc/settings.cmake
+++ b/cmake/compiler/gcc/settings.cmake
@@ -1,24 +1,24 @@
# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
-add_definitions(-fno-delete-null-pointer-checks)
-
if(PLATFORM EQUAL 32)
# Required on 32-bit systems to enable SSE2 (standard on x64)
- add_definitions(-msse2 -mfpmath=sse)
+ set(SSE_FLAGS "-msse2 -mfpmath=sse")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}")
endif()
add_definitions(-DHAVE_SSE2 -D__SSE2__)
-message(STATUS "GCC: SSE2 flags forced")
+message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
if( WITH_WARNINGS )
- add_definitions(-Wall -Wfatal-errors -Wextra)
+ set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
message(STATUS "GCC: All warnings enabled")
-else()
- add_definitions(--no-warnings)
- message(STATUS "GCC: All warnings disabled")
endif()
if( WITH_COREDEBUG )
- add_definitions(-ggdb3)
- message(STATUS "GCC: Debug-flags set (-ggdb3)")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
+ message(STATUS "GCC: Debug-flags set (-g3)")
endif()
diff --git a/cmake/compiler/icc/settings.cmake b/cmake/compiler/icc/settings.cmake
index b7e4cb742b3..58eb63b081d 100644
--- a/cmake/compiler/icc/settings.cmake
+++ b/cmake/compiler/icc/settings.cmake
@@ -9,10 +9,7 @@ endif()
if( WITH_WARNINGS )
add_definitions(-w1)
- message(STATUS "ICC All warnings enabled")
-else()
- add_definitions(-w)
- message(STATUS "ICC: All warnings disabled")
+ message(STATUS "ICC: All warnings enabled")
endif()
if( WITH_COREDEBUG )
diff --git a/cmake/compiler/xcode/settings.cmake b/cmake/compiler/xcode/settings.cmake
deleted file mode 100644
index b2f73e71310..00000000000
--- a/cmake/compiler/xcode/settings.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-# Set build-directive (used in core to tell which buildtype we used)
-add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')