infra
infra copied to clipboard
Add google RE2
It depends on abseil, not sure if this is going to work as is.
- Companion PR: https://github.com/compiler-explorer/compiler-explorer/pull/7594
Thanks for the PR! I will take a look at this next week probably
Locally I checked out abseil-cpp and re2 into a google subdirectory.
I build abseil-cpp.
cmake -G Ninja -DCMAKE_BUILD_TYPE:String=Release -DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install ..
ninja install
I build re2.
cmake -G Ninja -DCMAKE_BUILD_TYPE:String=Release -DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-Dabsl_DIR=$HOME/google/abseil-cpp/build/install/lib/cmake/absl/ ..
ninja install
Test program
#include <re2/re2.h>
#include <cassert>
int main() {
assert(RE2::FullMatch("hello", "h.*o"));
}
A CMakeLists.txt if needed:
cmake_minimum_required(VERSION 3.31)
project(test)
find_package(re2 REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE re2::re2)
I build it via
cmake -G Ninja -DCMAKE_BUILD_TYPE:String=Release -DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-Dabsl_DIR=$HOME/google/abseil-cpp/build/install/lib/cmake/absl/ \
-Dre2_DIR=$HOME/google/re2/build/install/lib/cmake/re ..
Sorry for the delay, im putting this on my todo list for next week