aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-03-23 20:35:30 +0100
committerShauren <shauren.trinity@gmail.com>2014-03-23 20:35:30 +0100
commit3affa3a82449868e79956a2008b792c1c4e78690 (patch)
tree2d9752a0dcc8aa8d2d3a99449028374d6850cf35
parente469ff5e88127621eae329b81cd171201c7ecead (diff)
Buildsystem/GCC: Enforce version 4.7.2 and enable c++11 compilation
-rw-r--r--cmake/compiler/gcc/settings.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake
index 25ee96c8562..6ce4c41ece7 100644
--- a/cmake/compiler/gcc/settings.cmake
+++ b/cmake/compiler/gcc/settings.cmake
@@ -1,6 +1,15 @@
# Set build-directive (used in core to tell which buildtype we used)
add_definitions(-D_BUILD_DIRECTIVE='"${CMAKE_BUILD_TYPE}"')
+set(GCC_EXPECTED_VERSION 4.7.2)
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_EXPECTED_VERSION)
+ message(FATAL_ERROR "GCC: TrinityCore requires version ${GCC_EXPECTED_VERSION} to build but found ${CMAKE_CXX_COMPILER_VERSION}")
+endif()
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+message(STATUS "GCC: Enabled c++11 support")
+
if(PLATFORM EQUAL 32)
# Required on 32-bit systems to enable SSE2 (standard on x64)
set(SSE_FLAGS "-msse2 -mfpmath=sse")