From 4bdbbfadbe9f21ddfe548d835d1fb8920df2465c Mon Sep 17 00:00:00 2001 From: Jack Zhang <32371937+jackzhxng@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:00:41 -0700 Subject: [PATCH 1/2] Fix cmake for regex lookahead --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6f481f..f8313bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,8 @@ if(SUPPORT_REGEX_LOOKAHEAD OR TOKENIZERS_BUILD_TEST) target_include_directories( regex_lookahead PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/third-party/pcre2/src) - target_link_options_shared_lib(regex_lookahead) + target_link_options_shared_lib(regex_lookahead) + target_link_libraries(tokenizers PUBLIC regex_lookahead) endif() # Build test From e22c58b85237b140d12e046aa2f80210c88f0290 Mon Sep 17 00:00:00 2001 From: Jack Zhang <32371937+jackzhxng@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:39:30 -0700 Subject: [PATCH 2/2] Mengwei PR review --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8313bc..74c8e1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,8 +118,7 @@ if(TOKENIZERS_BUILD_TEST) ${CMAKE_CURRENT_SOURCE_DIR}/third-party/sentencepiece ${CMAKE_CURRENT_SOURCE_DIR}/third-party/re2 ${CMAKE_CURRENT_SOURCE_DIR}/third-party/json/single_include) - target_link_libraries(${test_name} gtest_main GTest::gmock tokenizers - regex_lookahead) + target_link_libraries(${test_name} gtest_main GTest::gmock tokenizers) add_test(${test_name} "${test_name}") set_tests_properties(${test_name} PROPERTIES ENVIRONMENT ${test_env}) endforeach()