diff options
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/AbseilHelpers.cmake | 6 | ||||
-rw-r--r-- | CMake/README.md | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake index 588d4fa2..1541435d 100644 --- a/CMake/AbseilHelpers.cmake +++ b/CMake/AbseilHelpers.cmake @@ -41,7 +41,7 @@ endif() # LINKOPTS: List of link options # PUBLIC: Add this so that this library will be exported under absl:: # Also in IDE, target will appear in Abseil folder while non PUBLIC will be in Abseil/internal. -# TESTONLY: When added, this target will only be built if user passes -DABSL_RUN_TESTS=ON to CMake. +# TESTONLY: When added, this target will only be built if BUILD_TESTING=ON. # # Note: # By default, absl_cc_library will always create a library named absl_${NAME}, @@ -83,7 +83,7 @@ function(absl_cc_library) ${ARGN} ) - if(ABSL_CC_LIB_TESTONLY AND NOT ABSL_RUN_TESTS) + if(ABSL_CC_LIB_TESTONLY AND NOT BUILD_TESTING) return() endif() @@ -337,7 +337,7 @@ endfunction() # gtest_main # ) function(absl_cc_test) - if(NOT ABSL_RUN_TESTS) + if(NOT BUILD_TESTING) return() endif() diff --git a/CMake/README.md b/CMake/README.md index 8f73475a..5eee8171 100644 --- a/CMake/README.md +++ b/CMake/README.md @@ -52,7 +52,7 @@ target_link_libraries(my_exe absl::base absl::synchronization absl::strings) ### Running Abseil Tests with CMake -Use the `-DABSL_RUN_TESTS=ON` flag to run Abseil tests. Note that if the `-DBUILD_TESTING=OFF` flag is passed then Abseil tests will not be run. +Use the `-DBUILD_TESTING=ON` flag to run Abseil tests. You will need to provide Abseil with a Googletest dependency. There are two options for how to do this: @@ -70,7 +70,7 @@ For example, to run just the Abseil tests, you could use this script: cd path/to/abseil-cpp mkdir build cd build -cmake -DABSL_USE_GOOGLETEST_HEAD=ON -DABSL_RUN_TESTS=ON .. +cmake -DBUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=ON .. make -j ctest ``` |