diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index afed8d8b9d..61ac8c3c23 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -129,7 +129,7 @@ if(BUILD_re2) GIT_REPOSITORY "https://github.com/google/re2.git" GIT_TAG "2024-04-01" GIT_SHALLOW TRUE - #PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2024-04-01.patch" + PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2024-04-01.patch" ) FetchContent_MakeAvailable(re2) list(POP_BACK CMAKE_MESSAGE_INDENT) diff --git a/patches/re2-2024-04-01.patch b/patches/re2-2024-04-01.patch new file mode 100644 index 0000000000..73f73a69c1 --- /dev/null +++ b/patches/re2-2024-04-01.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bdac5af..cedaf6e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -131,6 +131,13 @@ set(RE2_HEADERS + + add_library(re2 ${RE2_SOURCES}) + target_compile_features(re2 PUBLIC cxx_std_14) ++if(APPLE) ++ set_target_properties(re2 PROPERTIES ++ INSTALL_RPATH "@loader_path") ++elseif(UNIX) ++ set_target_properties(re2 PROPERTIES ++ INSTALL_RPATH "$ORIGIN") ++endif() + target_include_directories(re2 PUBLIC $) + # CMake gives "set_target_properties called with incorrect number of arguments." + # errors if we don't quote ${RE2_HEADERS}, so quote it despite prevailing style.