Build: Cleanup boost CMakeLists from pre-c++11 flag checks

This commit is contained in:
Shauren
2022-11-05 01:08:17 +01:00
parent a761ebd6a6
commit c9f1606b76
2 changed files with 2 additions and 32 deletions

View File

@@ -12,8 +12,6 @@ if(WIN32)
set(BOOST_DEBUG ON)
if(DEFINED ENV{BOOST_ROOT})
set(BOOST_ROOT $ENV{BOOST_ROOT})
list(APPEND BOOST_LIBRARYDIR
${BOOST_ROOT}/lib${PLATFORM}-msvc-14.2 )
endif()
set(Boost_USE_STATIC_LIBS ON)
@@ -38,20 +36,6 @@ if(NOT Boost_FOUND)
endif()
endif()
# Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS
set(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_IOSTREAMS_LIBRARY})
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
check_cxx_source_compiles("
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
int main() { boost::filesystem::copy_file(boost::filesystem::path(), boost::filesystem::path()); }"
boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
unset(CMAKE_REQUIRED_FLAGS)
add_library(boost INTERFACE)
target_link_libraries(boost
@@ -70,16 +54,6 @@ target_compile_definitions(boost
-DBOOST_BIND_NO_PLACEHOLDERS
-DBOOST_SYSTEM_USE_UTF8)
if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
target_compile_definitions(boost
INTERFACE
-DBOOST_NO_CXX11_SCOPED_ENUMS)
endif()
target_compile_definitions(boost
INTERFACE
-DTC_HAS_BROKEN_WSTRING_REGEX)
if (WITH_BOOST_STACKTRACE AND NOT WIN32)
message("*** libbacktrace will be linked")

View File

@@ -18,15 +18,11 @@
#ifndef TrinityCore_Regex_h__
#define TrinityCore_Regex_h__
#ifndef TC_HAS_BROKEN_WSTRING_REGEX
#include <regex>
#define TC_REGEX_NAMESPACE std
#else
// std::wregex doesn't work with patterns provided in db2 files
// so we have to use boost
#include <boost/regex.hpp>
#define TC_REGEX_NAMESPACE boost
#endif
// regex compatibility layer, required for clang building with libstdc++-4.9
namespace Trinity
{
using regex = TC_REGEX_NAMESPACE :: regex;