aboutsummaryrefslogtreecommitdiff
path: root/dep/boost
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-12-10 19:11:10 +0100
committerShauren <shauren.trinity@gmail.com>2016-12-10 19:11:10 +0100
commitb6f1f8405f57e3b65c3b838ea87141716023bc72 (patch)
tree4c23791a4740b3fe639bad88514b10ddefeb73c6 /dep/boost
parentbfa9a4c9597c748734836fa2293f1ccf9724dbba (diff)
Core/Misc: Added regex compatibility layer to fall back to boost::regex for really old compiler
Diffstat (limited to 'dep/boost')
-rw-r--r--dep/boost/CMakeLists.txt36
1 files changed, 24 insertions, 12 deletions
diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt
index fc20347c2c8..988006b2ecd 100644
--- a/dep/boost/CMakeLists.txt
+++ b/dep/boost/CMakeLists.txt
@@ -26,11 +26,20 @@ if(WIN32)
set(Boost_USE_STATIC_RUNTIME OFF)
endif()
-find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams)
+include (CheckCXXSourceCompiles)
-# Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS
+check_cxx_source_compiles("
+ #include <regex>
+ int main() { std::wregex r(L\".*\"); }"
+ STD_HAS_WORKING_WREGEX)
-include (CheckCXXSourceCompiles)
+if (STD_HAS_WORKING_WREGEX)
+ find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams)
+else()
+ find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams regex)
+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})
@@ -54,17 +63,20 @@ target_include_directories(boost
INTERFACE
${Boost_INCLUDE_DIRS})
-if (boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
+target_compile_definitions(boost
+ INTERFACE
+ -DBOOST_DATE_TIME_NO_LIB
+ -DBOOST_REGEX_NO_LIB
+ -DBOOST_CHRONO_NO_LIB)
+
+if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
target_compile_definitions(boost
INTERFACE
- -DBOOST_DATE_TIME_NO_LIB
- -DBOOST_REGEX_NO_LIB
- -DBOOST_CHRONO_NO_LIB)
-else()
+ -DBOOST_NO_CXX11_SCOPED_ENUMS)
+endif()
+
+if (NOT STD_HAS_WORKING_WREGEX)
target_compile_definitions(boost
INTERFACE
- -DBOOST_DATE_TIME_NO_LIB
- -DBOOST_REGEX_NO_LIB
- -DBOOST_CHRONO_NO_LIB
- -DBOOST_NO_CXX11_SCOPED_ENUMS)
+ -DTC_HAS_BROKEN_WSTRING_REGEX)
endif()