Skip to content

Conversation

@jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Apr 22, 2025

It depends on abseil, not sure if this is going to work as is.

It depends on abseil, not sure if this is going to work as is
@partouf
Copy link
Member

partouf commented Apr 22, 2025

Thanks for the PR! I will take a look at this next week probably

@jmarrec
Copy link
Contributor Author

jmarrec commented Apr 22, 2025

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 ..

@partouf partouf marked this pull request as ready for review July 22, 2025 23:31
@partouf
Copy link
Member

partouf commented Jul 22, 2025

Sorry for the delay, im putting this on my todo list for next week

@partouf partouf merged commit c6b722e into compiler-explorer:main Jul 28, 2025
1 check passed
@jmarrec jmarrec deleted the re2 branch August 12, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants