`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 <perryl@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3932304..8ab0422 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -184,7 +184,7 @@
 
   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 @@
   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 @@
   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})