diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake index ae59a4758e..be8028da02 100644 --- a/cmake/compiler/msvc/settings.cmake +++ b/cmake/compiler/msvc/settings.cmake @@ -18,9 +18,11 @@ if(PLATFORM EQUAL 64) add_definitions("-D_WIN64") message(STATUS "MSVC: 64-bit platform, enforced -D_WIN64 parameter") - #Enable extended object support for debug compiles on X64 (not required on X86) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") - message(STATUS "MSVC: Enabled increased number of sections in object files") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.23026.0) + #Enable extended object support for debug compiles on X64 (not required on X86) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj") + message(STATUS "MSVC: Enabled increased number of sections in object files") + endif() else() # mark 32 bit executables large address aware so they can use > 2GB address space set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") @@ -39,6 +41,17 @@ add_definitions(-D_BUILD_DIRECTIVE=\\"$(ConfigurationName)\\") # multithreaded compiling on VS set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") +# /Zc:throwingNew. +# When you specify Zc:throwingNew on the command line, it instructs the compiler to assume +# that the program will eventually be linked with a conforming operator new implementation, +# and can omit all of these extra null checks from your program. +# http://blogs.msdn.com/b/vcblog/archive/2015/08/06/new-in-vs-2015-zc-throwingnew.aspx +if(NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.23026.0)) + # also enable /bigobj for ALL builds under visual studio 2015, increased number of templates in standard library + # makes this flag a requirement to build TC at all + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:throwingNew /bigobj") +endif() + # Define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES - eliminates the warning by changing the strcpy call to strcpy_s, which prevents buffer overruns add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES) message(STATUS "MSVC: Overloaded standard names") @@ -65,7 +78,7 @@ endif() # Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies) # (And yes, this is a verified , unresolved bug with MSVC... *sigh*) string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500") # Enable and treat as errors the following warnings to easily detect virtual function signature failures: # 'function' : member function does not override any base class virtual member function diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index db722f9fdb..5c013756f0 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2015 TrinityCore +# Copyright (C) 2008-2016 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/macros/CheckBuildDir.cmake b/cmake/macros/CheckBuildDir.cmake index 9a89de0b29..468253d6bd 100644 --- a/cmake/macros/CheckBuildDir.cmake +++ b/cmake/macros/CheckBuildDir.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2015 TrinityCore +# Copyright (C) 2008-2016 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/macros/ConfigureBoost.cmake b/cmake/macros/ConfigureBoost.cmake index 98caa5eb22..b3a71b8a68 100644 --- a/cmake/macros/ConfigureBoost.cmake +++ b/cmake/macros/ConfigureBoost.cmake @@ -1,13 +1,3 @@ -macro(get_WIN32_WINNT version) - if (WIN32 AND CMAKE_SYSTEM_VERSION) - set(ver ${CMAKE_SYSTEM_VERSION}) - string(REPLACE "." "" ver ${ver}) - string(REGEX REPLACE "([0-9])" "0\\1" ver ${ver}) - - set(${version} "0x${ver}") - endif() -endmacro() - if(WIN32) set(BOOST_DEBUG ON) if(DEFINED ENV{BOOST_ROOT}) @@ -25,11 +15,10 @@ if(WIN32) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) - get_WIN32_WINNT(ver) - add_definitions(-D_WIN32_WINNT=${ver}) + add_definitions(-D_WIN32_WINNT=0x0601) endif() -find_package(Boost 1.49 REQUIRED system filesystem thread program_options iostreams) +find_package(Boost 1.49 REQUIRED system filesystem thread program_options iostreams regex) add_definitions(-DBOOST_DATE_TIME_NO_LIB) add_definitions(-DBOOST_REGEX_NO_LIB) add_definitions(-DBOOST_CHRONO_NO_LIB) diff --git a/cmake/macros/FindBoost.cmake b/cmake/macros/FindBoost.cmake index 24ed90dd36..997336261d 100644 --- a/cmake/macros/FindBoost.cmake +++ b/cmake/macros/FindBoost.cmake @@ -478,8 +478,8 @@ else() # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} - "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55" - "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" + "1.60.0" "1.60" "1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" + "1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" diff --git a/cmake/macros/FindGit.cmake b/cmake/macros/FindGit.cmake index f5b0c6a9a3..3577428f43 100644 --- a/cmake/macros/FindGit.cmake +++ b/cmake/macros/FindGit.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2015 TrinityCore +# Copyright (C) 2008-2016 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/macros/GroupSources.cmake b/cmake/macros/GroupSources.cmake index 3acb03e7b4..198d8c3e18 100644 --- a/cmake/macros/GroupSources.cmake +++ b/cmake/macros/GroupSources.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2015 TrinityCore +# Copyright (C) 2008-2016 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/options.cmake b/cmake/options.cmake index 486cc90960..1961500130 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2015 TrinityCore +# Copyright (C) 2008-2016 TrinityCore # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index 3136730a6b..110b2f01a6 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -56,6 +56,13 @@ else() endif() if( WITH_COREDEBUG ) + message("") + message(" *** WITH_COREDEBUG - WARNING!") + message(" *** additional core debug logs have been enabled!") + message(" *** this setting doesn't help to get better crash logs!") + message(" *** in case you are searching for better crash logs use") + message(" *** -DCMAKE_BUILD_TYPE=RelWithDebug") + message(" *** DO NOT ENABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") message("* Use coreside debug : Yes") add_definitions(-DTRINITY_DEBUG) else()