summaryrefslogtreecommitdiff
path: root/absl/types
diff options
context:
space:
mode:
authorGravatar Adrien Devresse <adrien.devresse@epfl.ch>2017-10-31 22:15:26 +0100
committerGravatar Adrien Devresse <adrien.devresse@epfl.ch>2017-11-02 18:47:47 +0100
commita3322e3bfc96f33d3e195fd38a7c09f263e7e75f (patch)
treee219a8db3dbe4ebba5c8189888e2df12e4db1329 /absl/types
parent200b5a7cb0fb256ab47c933b3150aed91d9d3470 (diff)
Continue CMake support improvement
- Update documentation - Remove type target - Remove typos - simplify target - improve 1-1 matchign with Bazel targets
Diffstat (limited to 'absl/types')
-rw-r--r--absl/types/CMakeLists.txt54
1 files changed, 36 insertions, 18 deletions
diff --git a/absl/types/CMakeLists.txt b/absl/types/CMakeLists.txt
index 95b19fec..3e464497 100644
--- a/absl/types/CMakeLists.txt
+++ b/absl/types/CMakeLists.txt
@@ -23,12 +23,32 @@ list(APPEND TYPES_PUBLIC_HEADERS
)
+# any library
+absl_header_library(
+ TARGET
+ absl_any
+ PUBLIC_LIBRARIES
+ absl::utility
+ EXPORT_NAME
+ any
+)
+
+# span library
+absl_header_library(
+ TARGET
+ absl_span
+ PUBLIC_LIBRARIES
+ absl::utility
+ EXPORT_NAME
+ span
+)
+
+# bad_any_cast library
list(APPEND BAD_ANY_CAST_SRC
"bad_any_cast.cc"
${TYPES_PUBLIC_HEADERS}
)
-set(BAD_ANY_CAST_PUBLIC_LIBRARIES absl::base)
absl_library(
TARGET
@@ -36,13 +56,16 @@ absl_library(
SOURCES
${BAD_ANY_CAST_SRC}
PUBLIC_LIBRARIES
- ${BAD_ANY_CAST_PUBLIC_LIBRARIES}
+ absl::base absl::any
+ EXPORT_NAME
+ bad_any_cast
)
-
-set(OPTIONAL_SRC "optional.cc")
-set(OPTIONAL_PUBLIC_LIBRARIES absl::base)
+# optional library
+list(APPEND OPTIONAL_SRC
+ "optional.cc"
+)
absl_library(
TARGET
@@ -50,7 +73,9 @@ absl_library(
SOURCES
${OPTIONAL_SRC}
PUBLIC_LIBRARIES
- ${OPTIONAL_PUBLIC_LIBRARIES}
+ absl::base
+ EXPORT_NAME
+ optional
)
@@ -64,19 +89,12 @@ absl_library(
${BAD_OPTIONAL_ACCESS_SRC}
PUBLIC_LIBRARIES
${BAD_OPTIONAL_ACCESS_PUBLIC_LIBRARIES}
+ EXPORT_NAME
+ bad_optional_access
)
-absl_header_library(
- TARGET
- absl_types
- PUBLIC_LIBRARIES
- absl_optional absl_bad_any_cast absl_bad_optional_access
- EXPORT_NAME
- types
-)
-
#
## TESTS
#
@@ -84,7 +102,7 @@ absl_header_library(
# test any_test
set(ANY_TEST_SRC "any_test.cc")
-set(ANY_TEST_PUBLIC_LIBRARIES absl::base absl_throw_delegate absl_bad_any_cast test_instance_tracker_lib)
+set(ANY_TEST_PUBLIC_LIBRARIES absl::base absl::throw_delegate absl::any absl::bad_any_cast test_instance_tracker_lib)
absl_test(
TARGET
@@ -111,7 +129,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_bad_any_cast test_instance_tracker_lib)
+set(SPAN_TEST_PUBLIC_LIBRARIES absl::base absl::strings absl::throw_delegate absl::span test_instance_tracker_lib)
absl_test(
TARGET
@@ -139,7 +157,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 bad_optional_access)
+set(OPTIONAL_TEST_PUBLIC_LIBRARIES absl::base absl::throw_delegate absl::optional absl_bad_optional_access)
absl_test(
TARGET