From 7c5e396af825562ec8321fdbf2f1cf276b26e3ae Mon Sep 17 00:00:00 2001 From: Paul Wankadia Date: Thu, 1 Jun 2023 13:36:47 +0000 Subject: [PATCH] `target_compile_definitions()` needs a scope keyword. Fixes #429. Change-Id: I58ca8ecea8854dd899f711938c49fe75bfff640d Reviewed-on: https://code-review.googlesource.com/c/re2/+/61393 Reviewed-by: Perry Lorier Reviewed-by: Paul Wankadia --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 393230496..8ab04226a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,7 +184,7 @@ if(RE2_BUILD_TESTING) add_library(testing ${TESTING_SOURCES}) if(BUILD_SHARED_LIBS AND WIN32) - target_compile_definitions(testing -DRE2_BUILD_TESTING_DLL) + target_compile_definitions(testing PRIVATE -DRE2_BUILD_TESTING_DLL) endif() target_compile_features(testing PUBLIC cxx_std_14) target_link_libraries(testing PUBLIC re2 GTest::gtest) @@ -220,7 +220,7 @@ if(RE2_BUILD_TESTING) foreach(target ${TEST_TARGETS}) add_executable(${target} re2/testing/${target}.cc) if(BUILD_SHARED_LIBS AND WIN32) - target_compile_definitions(${target} -DRE2_CONSUME_TESTING_DLL) + target_compile_definitions(${target} PRIVATE -DRE2_CONSUME_TESTING_DLL) endif() target_compile_features(${target} PUBLIC cxx_std_14) target_link_libraries(${target} PUBLIC testing GTest::gtest_main ${EXTRA_TARGET_LINK_LIBRARIES}) @@ -230,7 +230,7 @@ if(RE2_BUILD_TESTING) foreach(target ${BENCHMARK_TARGETS}) add_executable(${target} re2/testing/${target}.cc) if(BUILD_SHARED_LIBS AND WIN32) - target_compile_definitions(${target} -DRE2_CONSUME_TESTING_DLL) + target_compile_definitions(${target} PRIVATE -DRE2_CONSUME_TESTING_DLL) endif() target_compile_features(${target} PUBLIC cxx_std_14) target_link_libraries(${target} PUBLIC testing benchmark::benchmark_main ${EXTRA_TARGET_LINK_LIBRARIES})