Core/Dep: fixed build with boost 1.71
This commit is contained in:
1 parent
e8b9723b02
commit
a723be6a64
3 files changed
+36
-26
No files matched your search
+28
-18
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||
# Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/>
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
@@ -18,15 +18,15 @@ if(WIN32)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10)
|
||||
set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib${PLATFORM}-msvc-14.0)
|
||||
else()
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.20)
|
||||
list(APPEND BOOST_LIBRARYDIR
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.1
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.0 )
|
||||
else()
|
||||
list(APPEND BOOST_LIBRARYDIR
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.2
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.1 )
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.20)
|
||||
list(APPEND BOOST_LIBRARYDIR
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.1
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.0 )
|
||||
else()
|
||||
list(APPEND BOOST_LIBRARYDIR
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.2
|
||||
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.1 )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
@@ -40,14 +40,23 @@ endif()
|
||||
|
||||
include (CheckCXXSourceCompiles)
|
||||
|
||||
check_cxx_source_compiles("
|
||||
#include <regex>
|
||||
int main() { std::wregex r(L\".*\"); }"
|
||||
STD_HAS_WORKING_WREGEX)
|
||||
|
||||
if (WIN32)
|
||||
# On windows the requirements are higher according to the wiki.
|
||||
set(BOOST_REQUIRED_VERSION 1.59)
|
||||
set(BOOST_REQUIRED_VERSION 1.66)
|
||||
else()
|
||||
set(BOOST_REQUIRED_VERSION 1.56)
|
||||
set(BOOST_REQUIRED_VERSION 1.58)
|
||||
endif()
|
||||
|
||||
find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams regex)
|
||||
if (STD_HAS_WORKING_WREGEX)
|
||||
find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams serialization)
|
||||
else()
|
||||
find_package(Boost ${BOOST_REQUIRED_VERSION} REQUIRED system filesystem thread program_options iostreams serialization regex)
|
||||
endif()
|
||||
|
||||
# Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS
|
||||
|
||||
@@ -78,10 +87,9 @@ target_compile_definitions(boost
|
||||
-DBOOST_DATE_TIME_NO_LIB
|
||||
-DBOOST_REGEX_NO_LIB
|
||||
-DBOOST_CHRONO_NO_LIB
|
||||
# Due to MSVC linking error boost::none" already defined in scripts_...
|
||||
# Due to MSVC linking error boost::none" already defined in scripts_...
|
||||
# May be removed when the requirement is raised to boost 1.61 on windows.
|
||||
-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
|
||||
-DBOOST_CHRONO_NO_LIB
|
||||
-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
|
||||
-DBOOST_ASIO_NO_DEPRECATED)
|
||||
|
||||
@@ -91,6 +99,8 @@ if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
|
||||
-DBOOST_NO_CXX11_SCOPED_ENUMS)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(boost
|
||||
INTERFACE
|
||||
-DTC_HAS_BROKEN_WSTRING_REGEX)
|
||||
if (NOT STD_HAS_WORKING_WREGEX)
|
||||
target_compile_definitions(boost
|
||||
INTERFACE
|
||||
-DTC_HAS_BROKEN_WSTRING_REGEX)
|
||||
endif()
|
||||
Reference in new issue
Block a user