diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e60d1f5..f8f781d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,13 +67,12 @@ endif() message("Looking for std::regex support...") try_run(RUN_RESULT COMPILE_RESULT ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/.cmake_has_regex_test.cpp) -if(RUN_RESULT EQUAL 0) - set(HAS_STD_REGEX TRUE) -else() - set(HAS_STD_REGEX FALSE) - add_definitions(-DNO_STD_REGEX) - message("old-style-connect check is disabled due to missing std::regex support") - message("Suppressions are disabled due to missing std::regex support") +if(NOT RUN_RESULT EQUAL 0) + message("Using boost::regex instead of std::regex") + set(CLAZY_USES_BOOST_REGEX TRUE) + add_definitions(-DCLAZY_USES_BOOST_REGEX) + find_package(Boost REQUIRED COMPONENTS regex) + include_directories(${Boost_INCLUDE_DIRS}) endif() include(ClazySources.cmake) @@ -128,6 +127,10 @@ macro(link_to_llvm name is_standalone) target_link_libraries(${name} clangTooling) target_link_libraries(${name} clangToolingCore) target_link_libraries(${name} ${clang_tooling_refactoring_lib}) + + if (CLAZY_USES_BOOST_REGEX) + target_link_libraries(${name} ${Boost_LIBRARIES}) + endif() endmacro() macro(add_clang_plugin name) |