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/xcode/settings.cmake2
3 files changed, 25 insertions, 12 deletions
diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake
new file mode 100644
index 00000000000..add9fa8694d
--- /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 -Wwrite-strings -Winit-self -Woverloaded-virtual -Wfatal-errors")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
+ 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..d74fc39031b 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 -Wwrite-strings -Winit-self -Woverloaded-virtual -Winvalid-pch -Wfatal-errors")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS}")
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/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)"')