about summary refs log tree commit diff
path: root/absl/base/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/CMakeLists.txt')
-rw-r--r--absl/base/CMakeLists.txt23
1 files changed, 22 insertions, 1 deletions
diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt
index 9d2de55fea90..4b7b53a7b91b 100644
--- a/absl/base/CMakeLists.txt
+++ b/absl/base/CMakeLists.txt
@@ -62,7 +62,6 @@ list(APPEND BASE_INTERNAL_HEADERS
 # absl_base main library
 list(APPEND BASE_SRC
   "internal/cycleclock.cc"
-  "internal/exception_safety_testing.cc"
   "internal/raw_logging.cc"
   "internal/spinlock.cc"
   "internal/sysinfo.cc"
@@ -117,6 +116,28 @@ absl_library(
     throw_delegate
 )
 
+if(BUILD_TESTING)
+  # exception-safety testing library
+  set(EXCEPTION_SAFETY_TESTING_SRC "internal/exception_safety_testing.cc")
+  set(EXCEPTION_SAFETY_TESTING_PUBLIC_LIBRARIES
+    ${ABSL_TEST_COMMON_LIBRARIES}
+    absl::base
+    absl::memory
+    absl::meta
+    absl::strings
+    absl::types
+  )
+
+absl_library(
+  TARGET
+    absl_base_internal_exception_safety_testing
+  SOURCES
+    ${EXCEPTION_SAFETY_TESTING_SRC}
+  PUBLIC_LIBRARIES
+    ${EXCEPTION_SAFETY_TESTING_PUBLIC_LIBRARIES}
+)
+endif()
+
 
 # dynamic_annotations library
 set(DYNAMIC_ANNOTATIONS_SRC "dynamic_annotations.cc")