summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
authorGravatar ahedberg <ahedberg@google.com>2018-10-22 13:10:23 -0400
committerGravatar GitHub <noreply@github.com>2018-10-22 13:10:23 -0400
commit5fbde92571a269675543b2c513747adb711b0ea1 (patch)
tree073afd2209e6f9d6f82f77619764dca75f7fd87e /absl
parent45221ccc4ed643e4209b0cc5798e97203f108fa8 (diff)
parentbd2d9a420747665ff7a85257b2d72df4c97e4cd6 (diff)
Merge pull request #136 from rongjiecomputer/cc_library
[CMake] Implement absl_cc_library as Bazel's cc_library
Diffstat (limited to 'absl')
-rw-r--r--absl/base/CMakeLists.txt96
-rw-r--r--absl/container/CMakeLists.txt8
-rw-r--r--absl/debugging/CMakeLists.txt2
-rw-r--r--absl/memory/CMakeLists.txt2
-rw-r--r--absl/strings/CMakeLists.txt8
-rw-r--r--absl/types/CMakeLists.txt10
6 files changed, 56 insertions, 70 deletions
diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt
index 04a6eb31..202003e6 100644
--- a/absl/base/CMakeLists.txt
+++ b/absl/base/CMakeLists.txt
@@ -78,54 +78,44 @@ absl_library(
${BASE_SRC}
PUBLIC_LIBRARIES
absl_dynamic_annotations
- absl_spinlock_wait
+ absl_internal_spinlock_wait
EXPORT_NAME
base
)
-# throw delegate library
-set(THROW_DELEGATE_SRC "internal/throw_delegate.cc")
-
-absl_library(
- TARGET
- absl_throw_delegate
- SOURCES
- ${THROW_DELEGATE_SRC}
- PUBLIC_LIBRARIES
- ${THROW_DELEGATE_PUBLIC_LIBRARIES}
- PRIVATE_COMPILE_FLAGS
- ${ABSL_EXCEPTIONS_FLAG}
- EXPORT_NAME
+absl_cc_library(
+ NAME
throw_delegate
+ SRCS
+ "internal/throw_delegate.cc"
+ HDRS
+ "internal/throw_delegate.h"
+ COPTS
+ ${ABSL_EXCEPTIONS_FLAG}
+ DEPS
+ absl::base
)
-if(BUILD_TESTING)
- # exception-safety testing library
- set(EXCEPTION_SAFETY_TESTING_SRC
+
+# exception-safety testing library
+absl_cc_library(
+ NAME
+ exception_safety_testing
+ HDRS
"internal/exception_safety_testing.h"
+ SRCS
"internal/exception_safety_testing.cc"
- )
- set(EXCEPTION_SAFETY_TESTING_PUBLIC_LIBRARIES
- ${ABSL_TEST_COMMON_LIBRARIES}
+ COPTS
+ ${ABSL_EXCEPTIONS_FLAG}
+ DEPS
absl::base
absl::memory
absl::meta
absl::strings
absl::optional
gtest
- )
-
-absl_library(
- TARGET
- absl_base_internal_exception_safety_testing
- SOURCES
- ${EXCEPTION_SAFETY_TESTING_SRC}
- PUBLIC_LIBRARIES
- ${EXCEPTION_SAFETY_TESTING_PUBLIC_LIBRARIES}
- PRIVATE_COMPILE_FLAGS
- ${ABSL_EXCEPTIONS_FLAG}
+ TESTONLY
)
-endif()
# dynamic_annotations library
@@ -138,29 +128,25 @@ absl_library(
${DYNAMIC_ANNOTATIONS_SRC}
)
-
-# spinlock_wait library
-set(SPINLOCK_WAIT_SRC "internal/spinlock_wait.cc")
-
-absl_library(
- TARGET
- absl_spinlock_wait
- SOURCES
- ${SPINLOCK_WAIT_SRC}
-)
-
-
-# malloc_internal library
-list(APPEND MALLOC_INTERNAL_SRC
- "internal/low_level_alloc.cc"
+absl_cc_library(
+ NAME
+ spinlock_wait
+ SRCS
+ "internal/spinlock_wait.cc"
+ HDRS
+ "internal/scheduling_mode.h"
+ "internal/spinlock_wait.h"
)
-absl_library(
- TARGET
- absl_malloc_internal
- SOURCES
- ${MALLOC_INTERNAL_SRC}
- PUBLIC_LIBRARIES
+absl_cc_library(
+ NAME
+ malloc_internal
+ SRCS
+ "internal/low_level_alloc.cc"
+ HDRS
+ "internal/direct_mmap.h"
+ "internal/low_level_alloc.h"
+ DEPS
absl_dynamic_annotations
)
@@ -211,7 +197,7 @@ absl_test(
# test absl_throw_delegate_test
set(THROW_DELEGATE_TEST_SRC "throw_delegate_test.cc")
-set(THROW_DELEGATE_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate)
+set(THROW_DELEGATE_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate)
absl_test(
TARGET
@@ -368,7 +354,7 @@ absl_test(
set(EXCEPTION_SAFETY_TESTING_TEST_SRC "exception_safety_testing_test.cc")
set(EXCEPTION_SAFETY_TESTING_TEST_PUBLIC_LIBRARIES
absl::base
- absl_base_internal_exception_safety_testing
+ absl_internal_exception_safety_testing
absl::memory
absl::meta
absl::strings
diff --git a/absl/container/CMakeLists.txt b/absl/container/CMakeLists.txt
index 9e406902..5de75f59 100644
--- a/absl/container/CMakeLists.txt
+++ b/absl/container/CMakeLists.txt
@@ -82,7 +82,7 @@ absl_library(
# test fixed_array_test
set(FIXED_ARRAY_TEST_SRC "fixed_array_test.cc")
-set(FIXED_ARRAY_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate test_instance_tracker_lib)
+set(FIXED_ARRAY_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate test_instance_tracker_lib)
absl_test(
TARGET
@@ -111,7 +111,7 @@ absl_test(
set(FIXED_ARRAY_EXCEPTION_SAFETY_TEST_SRC "fixed_array_exception_safety_test.cc")
set(FIXED_ARRAY_EXCEPTION_SAFETY_TEST_PUBLIC_LIBRARIES
absl::container
- absl_base_internal_exception_safety_testing
+ absl_internal_exception_safety_testing
)
absl_test(
@@ -128,7 +128,7 @@ absl_test(
# test inlined_vector_test
set(INLINED_VECTOR_TEST_SRC "inlined_vector_test.cc")
-set(INLINED_VECTOR_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate test_instance_tracker_lib)
+set(INLINED_VECTOR_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate test_instance_tracker_lib)
absl_test(
TARGET
@@ -153,7 +153,7 @@ absl_test(
# test test_instance_tracker_test
set(TEST_INSTANCE_TRACKER_TEST_SRC "internal/test_instance_tracker_test.cc")
-set(TEST_INSTANCE_TRACKER_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate test_instance_tracker_lib)
+set(TEST_INSTANCE_TRACKER_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate test_instance_tracker_lib)
absl_test(
diff --git a/absl/debugging/CMakeLists.txt b/absl/debugging/CMakeLists.txt
index 4af2ec8a..266c2ca0 100644
--- a/absl/debugging/CMakeLists.txt
+++ b/absl/debugging/CMakeLists.txt
@@ -85,7 +85,7 @@ absl_library(
${SYMBOLIZE_SRC}
PUBLIC_LIBRARIES
absl::base
- absl_malloc_internal
+ absl_internal_malloc_internal
EXPORT_NAME
symbolize
)
diff --git a/absl/memory/CMakeLists.txt b/absl/memory/CMakeLists.txt
index 5958f5c5..7d731e8a 100644
--- a/absl/memory/CMakeLists.txt
+++ b/absl/memory/CMakeLists.txt
@@ -53,7 +53,7 @@ absl_test(
set(MEMORY_EXCEPTION_SAFETY_TEST_SRC "memory_exception_safety_test.cc")
set(MEMORY_EXCEPTION_SAFETY_TEST_PUBLIC_LIBRARIES
absl::memory
- absl_base_internal_exception_safety_testing
+ absl_internal_exception_safety_testing
)
absl_test(
diff --git a/absl/strings/CMakeLists.txt b/absl/strings/CMakeLists.txt
index f3e41623..4df3bac3 100644
--- a/absl/strings/CMakeLists.txt
+++ b/absl/strings/CMakeLists.txt
@@ -67,7 +67,7 @@ list(APPEND STRINGS_SRC
${STRINGS_PUBLIC_HEADERS}
${STRINGS_INTERNAL_HEADERS}
)
-set(STRINGS_PUBLIC_LIBRARIES absl::base absl_throw_delegate)
+set(STRINGS_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate)
absl_library(
TARGET
@@ -207,7 +207,7 @@ absl_test(
# test string_view_test
set(STRING_VIEW_TEST_SRC "string_view_test.cc")
-set(STRING_VIEW_TEST_PUBLIC_LIBRARIES absl::strings absl_throw_delegate absl::base)
+set(STRING_VIEW_TEST_PUBLIC_LIBRARIES absl::strings absl_internal_throw_delegate absl::base)
absl_test(
TARGET
@@ -235,7 +235,7 @@ absl_test(
# test str_replace_test
set(STR_REPLACE_TEST_SRC "str_replace_test.cc")
-set(STR_REPLACE_TEST_PUBLIC_LIBRARIES absl::strings absl::base absl_throw_delegate)
+set(STR_REPLACE_TEST_PUBLIC_LIBRARIES absl::strings absl::base absl_internal_throw_delegate)
absl_test(
TARGET
@@ -249,7 +249,7 @@ absl_test(
# test str_split_test
set(STR_SPLIT_TEST_SRC "str_split_test.cc")
-set(STR_SPLIT_TEST_PUBLIC_LIBRARIES absl::strings absl::base absl_throw_delegate)
+set(STR_SPLIT_TEST_PUBLIC_LIBRARIES absl::strings absl::base absl_internal_throw_delegate)
absl_test(
TARGET
diff --git a/absl/types/CMakeLists.txt b/absl/types/CMakeLists.txt
index 2f2e3a77..bc6c39e9 100644
--- a/absl/types/CMakeLists.txt
+++ b/absl/types/CMakeLists.txt
@@ -123,7 +123,7 @@ absl_library(
# test any_test
set(ANY_TEST_SRC "any_test.cc")
-set(ANY_TEST_PUBLIC_LIBRARIES absl::base absl::throw_delegate absl::any absl::bad_any_cast test_instance_tracker_lib)
+set(ANY_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate absl::any absl::bad_any_cast test_instance_tracker_lib)
absl_test(
TARGET
@@ -152,7 +152,7 @@ set(ANY_EXCEPTION_SAFETY_TEST_SRC "any_exception_safety_test.cc")
set(ANY_EXCEPTION_SAFETY_TEST_PUBLIC_LIBRARIES
absl::any
absl::base
- absl_base_internal_exception_safety_testing
+ absl_internal_exception_safety_testing
)
absl_test(
@@ -169,7 +169,7 @@ absl_test(
# test span_test
set(SPAN_TEST_SRC "span_test.cc")
-set(SPAN_TEST_PUBLIC_LIBRARIES absl::base absl::strings absl::throw_delegate absl::span test_instance_tracker_lib)
+set(SPAN_TEST_PUBLIC_LIBRARIES absl::base absl::strings absl_internal_throw_delegate absl::span test_instance_tracker_lib)
absl_test(
TARGET
@@ -197,7 +197,7 @@ absl_test(
# test optional_test
set(OPTIONAL_TEST_SRC "optional_test.cc")
-set(OPTIONAL_TEST_PUBLIC_LIBRARIES absl::base absl::throw_delegate absl::optional absl_bad_optional_access)
+set(OPTIONAL_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate absl::optional absl_bad_optional_access)
absl_test(
TARGET
@@ -213,7 +213,7 @@ absl_test(
set(OPTIONAL_EXCEPTION_SAFETY_TEST_SRC "optional_exception_safety_test.cc")
set(OPTIONAL_EXCEPTION_SAFETY_TEST_PUBLIC_LIBRARIES
absl::optional
- absl_base_internal_exception_safety_testing
+ absl_internal_exception_safety_testing
)
absl_test(