Permalink
Browse files

Core/Buildsystem: Clean up compileflags when compiling with warnings …

…fully enabled.

 -Wwrite-strings is default enabled when -Wall is set in clang/gcc, hence removed.
 -Woverloaded-virtual is now enabled for C++-code only, this removes the useless warnings when dabbling with C-only code.
  • Loading branch information...
1 parent 371fbf5 commit 8ef48ecc99caa9c28b7d53bb45e6bd56872170a1 @click click committed Nov 26, 2012
View
@@ -12,7 +12,7 @@
project(TrinityCore)
# CMake policies (can not be handled elsewhere)
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0005 OLD)
# Set RPATH-handing (CMake parameters)
@@ -2,9 +2,9 @@
add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"')
if(WITH_WARNINGS)
- set(WARNING_FLAGS "-W -Wall -Wextra -Wwrite-strings -Winit-self -Woverloaded-virtual -Wfatal-errors")
+ 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}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
message(STATUS "Clang: All warnings enabled")
endif()
@@ -11,9 +11,9 @@ add_definitions(-DHAVE_SSE2 -D__SSE2__)
message(STATUS "GCC: SFMT enabled, SSE2 flags forced")
if( WITH_WARNINGS )
- set(WARNING_FLAGS "-W -Wall -Wextra -Wwrite-strings -Winit-self -Woverloaded-virtual -Winvalid-pch -Wfatal-errors")
+ 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}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual")
message(STATUS "GCC: All warnings enabled")
endif()
@@ -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 )
@@ -150,7 +150,6 @@ endif()
add_dependencies(worldserver revision.h)
-
if( UNIX AND NOT NOJEM )
set(worldserver_LINK_FLAGS "-pthread -lncurses ${worldserver_LINK_FLAGS}")
endif()

0 comments on commit 8ef48ec

Please sign in to comment.