1include(CMakeParseArguments) 2include(GNUInstallDirs) 3 4set(ABSL_INTERNAL_DLL_FILES 5 "algorithm/algorithm.h" 6 "algorithm/container.h" 7 "base/attributes.h" 8 "base/call_once.h" 9 "base/casts.h" 10 "base/config.h" 11 "base/const_init.h" 12 "base/dynamic_annotations.h" 13 "base/internal/atomic_hook.h" 14 "base/internal/cycleclock.cc" 15 "base/internal/cycleclock.h" 16 "base/internal/cycleclock_config.h" 17 "base/internal/direct_mmap.h" 18 "base/internal/dynamic_annotations.h" 19 "base/internal/endian.h" 20 "base/internal/errno_saver.h" 21 "base/internal/fast_type_id.h" 22 "base/internal/hide_ptr.h" 23 "base/internal/identity.h" 24 "base/internal/invoke.h" 25 "base/internal/inline_variable.h" 26 "base/internal/low_level_alloc.cc" 27 "base/internal/low_level_alloc.h" 28 "base/internal/low_level_scheduling.h" 29 "base/internal/nullability_impl.h" 30 "base/internal/per_thread_tls.h" 31 "base/prefetch.h" 32 "base/internal/pretty_function.h" 33 "base/internal/raw_logging.cc" 34 "base/internal/raw_logging.h" 35 "base/internal/scheduling_mode.h" 36 "base/internal/scoped_set_env.cc" 37 "base/internal/scoped_set_env.h" 38 "base/internal/strerror.h" 39 "base/internal/strerror.cc" 40 "base/internal/spinlock.cc" 41 "base/internal/spinlock.h" 42 "base/internal/spinlock_wait.cc" 43 "base/internal/spinlock_wait.h" 44 "base/internal/sysinfo.cc" 45 "base/internal/sysinfo.h" 46 "base/internal/thread_identity.cc" 47 "base/internal/thread_identity.h" 48 "base/internal/throw_delegate.cc" 49 "base/internal/throw_delegate.h" 50 "base/internal/tsan_mutex_interface.h" 51 "base/internal/unaligned_access.h" 52 "base/internal/unscaledcycleclock.cc" 53 "base/internal/unscaledcycleclock.h" 54 "base/internal/unscaledcycleclock_config.h" 55 "base/log_severity.cc" 56 "base/log_severity.h" 57 "base/macros.h" 58 "base/no_destructor.h" 59 "base/nullability.h" 60 "base/optimization.h" 61 "base/options.h" 62 "base/policy_checks.h" 63 "base/port.h" 64 "base/thread_annotations.h" 65 "cleanup/cleanup.h" 66 "cleanup/internal/cleanup.h" 67 "container/btree_map.h" 68 "container/btree_set.h" 69 "container/fixed_array.h" 70 "container/flat_hash_map.h" 71 "container/flat_hash_set.h" 72 "container/inlined_vector.h" 73 "container/internal/btree.h" 74 "container/internal/btree_container.h" 75 "container/internal/common.h" 76 "container/internal/common_policy_traits.h" 77 "container/internal/compressed_tuple.h" 78 "container/internal/container_memory.h" 79 "container/internal/hash_function_defaults.h" 80 "container/internal/hash_policy_traits.h" 81 "container/internal/hashtable_debug.h" 82 "container/internal/hashtable_debug_hooks.h" 83 "container/internal/hashtablez_sampler.cc" 84 "container/internal/hashtablez_sampler.h" 85 "container/internal/hashtablez_sampler_force_weak_definition.cc" 86 "container/internal/inlined_vector.h" 87 "container/internal/layout.h" 88 "container/internal/node_slot_policy.h" 89 "container/internal/raw_hash_map.h" 90 "container/internal/raw_hash_set.cc" 91 "container/internal/raw_hash_set.h" 92 "container/internal/tracked.h" 93 "container/node_hash_map.h" 94 "container/node_hash_set.h" 95 "crc/crc32c.cc" 96 "crc/crc32c.h" 97 "crc/internal/cpu_detect.cc" 98 "crc/internal/cpu_detect.h" 99 "crc/internal/crc32c.h" 100 "crc/internal/crc32c_inline.h" 101 "crc/internal/crc32_x86_arm_combined_simd.h" 102 "crc/internal/crc.cc" 103 "crc/internal/crc.h" 104 "crc/internal/crc_cord_state.cc" 105 "crc/internal/crc_cord_state.h" 106 "crc/internal/crc_internal.h" 107 "crc/internal/crc_x86_arm_combined.cc" 108 "crc/internal/crc_memcpy_fallback.cc" 109 "crc/internal/crc_memcpy.h" 110 "crc/internal/crc_memcpy_x86_arm_combined.cc" 111 "crc/internal/crc_non_temporal_memcpy.cc" 112 "crc/internal/crc_x86_arm_combined.cc" 113 "crc/internal/non_temporal_arm_intrinsics.h" 114 "crc/internal/non_temporal_memcpy.h" 115 "debugging/failure_signal_handler.cc" 116 "debugging/failure_signal_handler.h" 117 "debugging/leak_check.h" 118 "debugging/stacktrace.cc" 119 "debugging/stacktrace.h" 120 "debugging/symbolize.cc" 121 "debugging/symbolize.h" 122 "debugging/internal/address_is_readable.cc" 123 "debugging/internal/address_is_readable.h" 124 "debugging/internal/demangle.cc" 125 "debugging/internal/demangle.h" 126 "debugging/internal/elf_mem_image.cc" 127 "debugging/internal/elf_mem_image.h" 128 "debugging/internal/examine_stack.cc" 129 "debugging/internal/examine_stack.h" 130 "debugging/internal/stack_consumption.cc" 131 "debugging/internal/stack_consumption.h" 132 "debugging/internal/stacktrace_config.h" 133 "debugging/internal/symbolize.h" 134 "debugging/internal/vdso_support.cc" 135 "debugging/internal/vdso_support.h" 136 "functional/any_invocable.h" 137 "functional/internal/front_binder.h" 138 "functional/bind_front.h" 139 "functional/function_ref.h" 140 "functional/internal/any_invocable.h" 141 "functional/internal/function_ref.h" 142 "functional/overload.h" 143 "hash/hash.h" 144 "hash/internal/city.h" 145 "hash/internal/city.cc" 146 "hash/internal/hash.h" 147 "hash/internal/hash.cc" 148 "hash/internal/spy_hash_state.h" 149 "hash/internal/low_level_hash.h" 150 "hash/internal/low_level_hash.cc" 151 "log/absl_check.h" 152 "log/absl_log.h" 153 "log/absl_vlog_is_on.h" 154 "log/check.h" 155 "log/die_if_null.cc" 156 "log/die_if_null.h" 157 "log/globals.cc" 158 "log/globals.h" 159 "log/internal/append_truncated.h" 160 "log/internal/check_impl.h" 161 "log/internal/check_op.cc" 162 "log/internal/check_op.h" 163 "log/internal/conditions.cc" 164 "log/internal/conditions.h" 165 "log/internal/config.h" 166 "log/internal/fnmatch.h" 167 "log/internal/fnmatch.cc" 168 "log/internal/globals.cc" 169 "log/internal/globals.h" 170 "log/internal/log_format.cc" 171 "log/internal/log_format.h" 172 "log/internal/log_impl.h" 173 "log/internal/log_message.cc" 174 "log/internal/log_message.h" 175 "log/internal/log_sink_set.cc" 176 "log/internal/log_sink_set.h" 177 "log/internal/nullguard.cc" 178 "log/internal/nullguard.h" 179 "log/internal/nullstream.h" 180 "log/internal/proto.h" 181 "log/internal/proto.cc" 182 "log/internal/strip.h" 183 "log/internal/structured.h" 184 "log/internal/vlog_config.cc" 185 "log/internal/vlog_config.h" 186 "log/internal/voidify.h" 187 "log/initialize.cc" 188 "log/initialize.h" 189 "log/log.h" 190 "log/log_entry.cc" 191 "log/log_entry.h" 192 "log/log_sink.cc" 193 "log/log_sink.h" 194 "log/log_sink_registry.h" 195 "log/log_streamer.h" 196 "log/structured.h" 197 "log/vlog_is_on.h" 198 "memory/memory.h" 199 "meta/type_traits.h" 200 "numeric/bits.h" 201 "numeric/int128.cc" 202 "numeric/int128.h" 203 "numeric/internal/bits.h" 204 "numeric/internal/representation.h" 205 "profiling/internal/exponential_biased.cc" 206 "profiling/internal/exponential_biased.h" 207 "profiling/internal/periodic_sampler.cc" 208 "profiling/internal/periodic_sampler.h" 209 "profiling/internal/sample_recorder.h" 210 "random/bernoulli_distribution.h" 211 "random/beta_distribution.h" 212 "random/bit_gen_ref.h" 213 "random/discrete_distribution.cc" 214 "random/discrete_distribution.h" 215 "random/distributions.h" 216 "random/exponential_distribution.h" 217 "random/gaussian_distribution.cc" 218 "random/gaussian_distribution.h" 219 "random/internal/distribution_caller.h" 220 "random/internal/fastmath.h" 221 "random/internal/fast_uniform_bits.h" 222 "random/internal/generate_real.h" 223 "random/internal/iostream_state_saver.h" 224 "random/internal/nonsecure_base.h" 225 "random/internal/pcg_engine.h" 226 "random/internal/platform.h" 227 "random/internal/pool_urbg.cc" 228 "random/internal/pool_urbg.h" 229 "random/internal/randen.cc" 230 "random/internal/randen.h" 231 "random/internal/randen_detect.cc" 232 "random/internal/randen_detect.h" 233 "random/internal/randen_engine.h" 234 "random/internal/randen_hwaes.cc" 235 "random/internal/randen_hwaes.h" 236 "random/internal/randen_round_keys.cc" 237 "random/internal/randen_slow.cc" 238 "random/internal/randen_slow.h" 239 "random/internal/randen_traits.h" 240 "random/internal/salted_seed_seq.h" 241 "random/internal/seed_material.cc" 242 "random/internal/seed_material.h" 243 "random/internal/sequence_urbg.h" 244 "random/internal/traits.h" 245 "random/internal/uniform_helper.h" 246 "random/internal/wide_multiply.h" 247 "random/log_uniform_int_distribution.h" 248 "random/poisson_distribution.h" 249 "random/random.h" 250 "random/seed_gen_exception.cc" 251 "random/seed_gen_exception.h" 252 "random/seed_sequences.cc" 253 "random/seed_sequences.h" 254 "random/uniform_int_distribution.h" 255 "random/uniform_real_distribution.h" 256 "random/zipf_distribution.h" 257 "status/internal/status_internal.h" 258 "status/internal/status_internal.cc" 259 "status/internal/statusor_internal.h" 260 "status/status.h" 261 "status/status.cc" 262 "status/statusor.h" 263 "status/statusor.cc" 264 "status/status_payload_printer.h" 265 "status/status_payload_printer.cc" 266 "strings/ascii.cc" 267 "strings/ascii.h" 268 "strings/charconv.cc" 269 "strings/charconv.h" 270 "strings/charset.h" 271 "strings/cord.cc" 272 "strings/cord.h" 273 "strings/cord_analysis.cc" 274 "strings/cord_analysis.h" 275 "strings/cord_buffer.cc" 276 "strings/cord_buffer.h" 277 "strings/escaping.cc" 278 "strings/escaping.h" 279 "strings/internal/charconv_bigint.cc" 280 "strings/internal/charconv_bigint.h" 281 "strings/internal/charconv_parse.cc" 282 "strings/internal/charconv_parse.h" 283 "strings/internal/cord_data_edge.h" 284 "strings/internal/cord_internal.cc" 285 "strings/internal/cord_internal.h" 286 "strings/internal/cord_rep_btree.cc" 287 "strings/internal/cord_rep_btree.h" 288 "strings/internal/cord_rep_btree_navigator.cc" 289 "strings/internal/cord_rep_btree_navigator.h" 290 "strings/internal/cord_rep_btree_reader.cc" 291 "strings/internal/cord_rep_btree_reader.h" 292 "strings/internal/cord_rep_crc.cc" 293 "strings/internal/cord_rep_crc.h" 294 "strings/internal/cord_rep_consume.h" 295 "strings/internal/cord_rep_consume.cc" 296 "strings/internal/cord_rep_flat.h" 297 "strings/internal/cordz_functions.cc" 298 "strings/internal/cordz_functions.h" 299 "strings/internal/cordz_handle.cc" 300 "strings/internal/cordz_handle.h" 301 "strings/internal/cordz_info.cc" 302 "strings/internal/cordz_info.h" 303 "strings/internal/cordz_sample_token.cc" 304 "strings/internal/cordz_sample_token.h" 305 "strings/internal/cordz_statistics.h" 306 "strings/internal/cordz_update_scope.h" 307 "strings/internal/cordz_update_tracker.h" 308 "strings/internal/damerau_levenshtein_distance.h" 309 "strings/internal/damerau_levenshtein_distance.cc" 310 "strings/internal/stl_type_traits.h" 311 "strings/internal/string_constant.h" 312 "strings/internal/stringify_sink.h" 313 "strings/internal/stringify_sink.cc" 314 "strings/internal/has_absl_stringify.h" 315 "strings/has_absl_stringify.h" 316 "strings/has_ostream_operator.h" 317 "strings/match.cc" 318 "strings/match.h" 319 "strings/numbers.cc" 320 "strings/numbers.h" 321 "strings/str_format.h" 322 "strings/str_cat.cc" 323 "strings/str_cat.h" 324 "strings/str_join.h" 325 "strings/str_replace.cc" 326 "strings/str_replace.h" 327 "strings/str_split.cc" 328 "strings/str_split.h" 329 "strings/string_view.cc" 330 "strings/string_view.h" 331 "strings/strip.h" 332 "strings/substitute.cc" 333 "strings/substitute.h" 334 "strings/internal/escaping.h" 335 "strings/internal/escaping.cc" 336 "strings/internal/memutil.cc" 337 "strings/internal/memutil.h" 338 "strings/internal/ostringstream.cc" 339 "strings/internal/ostringstream.h" 340 "strings/internal/pow10_helper.cc" 341 "strings/internal/pow10_helper.h" 342 "strings/internal/resize_uninitialized.h" 343 "strings/internal/str_format/arg.cc" 344 "strings/internal/str_format/arg.h" 345 "strings/internal/str_format/bind.cc" 346 "strings/internal/str_format/bind.h" 347 "strings/internal/str_format/checker.h" 348 "strings/internal/str_format/constexpr_parser.h" 349 "strings/internal/str_format/extension.cc" 350 "strings/internal/str_format/extension.h" 351 "strings/internal/str_format/float_conversion.cc" 352 "strings/internal/str_format/float_conversion.h" 353 "strings/internal/str_format/output.cc" 354 "strings/internal/str_format/output.h" 355 "strings/internal/str_format/parser.cc" 356 "strings/internal/str_format/parser.h" 357 "strings/internal/str_join_internal.h" 358 "strings/internal/str_split_internal.h" 359 "strings/internal/utf8.cc" 360 "strings/internal/utf8.h" 361 "synchronization/barrier.cc" 362 "synchronization/barrier.h" 363 "synchronization/blocking_counter.cc" 364 "synchronization/blocking_counter.h" 365 "synchronization/mutex.cc" 366 "synchronization/mutex.h" 367 "synchronization/notification.cc" 368 "synchronization/notification.h" 369 "synchronization/internal/create_thread_identity.cc" 370 "synchronization/internal/create_thread_identity.h" 371 "synchronization/internal/futex.h" 372 "synchronization/internal/futex_waiter.h" 373 "synchronization/internal/futex_waiter.cc" 374 "synchronization/internal/graphcycles.cc" 375 "synchronization/internal/graphcycles.h" 376 "synchronization/internal/kernel_timeout.h" 377 "synchronization/internal/kernel_timeout.cc" 378 "synchronization/internal/per_thread_sem.cc" 379 "synchronization/internal/per_thread_sem.h" 380 "synchronization/internal/pthread_waiter.h" 381 "synchronization/internal/pthread_waiter.cc" 382 "synchronization/internal/sem_waiter.h" 383 "synchronization/internal/sem_waiter.cc" 384 "synchronization/internal/stdcpp_waiter.h" 385 "synchronization/internal/stdcpp_waiter.cc" 386 "synchronization/internal/thread_pool.h" 387 "synchronization/internal/waiter.h" 388 "synchronization/internal/waiter_base.h" 389 "synchronization/internal/waiter_base.cc" 390 "synchronization/internal/win32_waiter.h" 391 "synchronization/internal/win32_waiter.cc" 392 "time/civil_time.cc" 393 "time/civil_time.h" 394 "time/clock.cc" 395 "time/clock.h" 396 "time/duration.cc" 397 "time/format.cc" 398 "time/time.cc" 399 "time/time.h" 400 "time/internal/cctz/include/cctz/civil_time.h" 401 "time/internal/cctz/include/cctz/civil_time_detail.h" 402 "time/internal/cctz/include/cctz/time_zone.h" 403 "time/internal/cctz/include/cctz/zone_info_source.h" 404 "time/internal/cctz/src/civil_time_detail.cc" 405 "time/internal/cctz/src/time_zone_fixed.cc" 406 "time/internal/cctz/src/time_zone_fixed.h" 407 "time/internal/cctz/src/time_zone_format.cc" 408 "time/internal/cctz/src/time_zone_if.cc" 409 "time/internal/cctz/src/time_zone_if.h" 410 "time/internal/cctz/src/time_zone_impl.cc" 411 "time/internal/cctz/src/time_zone_impl.h" 412 "time/internal/cctz/src/time_zone_info.cc" 413 "time/internal/cctz/src/time_zone_info.h" 414 "time/internal/cctz/src/time_zone_libc.cc" 415 "time/internal/cctz/src/time_zone_libc.h" 416 "time/internal/cctz/src/time_zone_lookup.cc" 417 "time/internal/cctz/src/time_zone_posix.cc" 418 "time/internal/cctz/src/time_zone_posix.h" 419 "time/internal/cctz/src/tzfile.h" 420 "time/internal/cctz/src/zone_info_source.cc" 421 "types/any.h" 422 "types/bad_any_cast.cc" 423 "types/bad_any_cast.h" 424 "types/bad_optional_access.cc" 425 "types/bad_optional_access.h" 426 "types/bad_variant_access.cc" 427 "types/bad_variant_access.h" 428 "types/compare.h" 429 "types/internal/variant.h" 430 "types/optional.h" 431 "types/internal/optional.h" 432 "types/span.h" 433 "types/internal/span.h" 434 "types/variant.h" 435 "utility/internal/if_constexpr.h" 436 "utility/utility.h" 437 "debugging/leak_check.cc" 438) 439 440set(ABSL_INTERNAL_DLL_TARGETS 441 "absl_check" 442 "absl_log" 443 "algorithm" 444 "algorithm_container" 445 "any" 446 "any_invocable" 447 "atomic_hook" 448 "bad_any_cast" 449 "bad_any_cast_impl" 450 "bad_optional_access" 451 "bad_variant_access" 452 "base" 453 "base_internal" 454 "bind_front" 455 "bits" 456 "btree" 457 "check" 458 "city" 459 "civil_time" 460 "compare" 461 "compressed_tuple" 462 "config" 463 "container" 464 "container_common" 465 "container_memory" 466 "cord" 467 "cord_internal" 468 "cordz_functions" 469 "cordz_handle" 470 "cordz_info" 471 "cordz_sample_token" 472 "core_headers" 473 "counting_allocator" 474 "crc_cord_state" 475 "crc_cpu_detect" 476 "crc_internal" 477 "crc32c" 478 "debugging" 479 "debugging_internal" 480 "demangle_internal" 481 "die_if_null" 482 "dynamic_annotations" 483 "endian" 484 "examine_stack" 485 "exponential_biased" 486 "failure_signal_handler" 487 "fixed_array" 488 "flat_hash_map" 489 "flat_hash_set" 490 "function_ref" 491 "graphcycles_internal" 492 "hash" 493 "hash_function_defaults" 494 "hash_policy_traits" 495 "hashtable_debug" 496 "hashtable_debug_hooks" 497 "hashtablez_sampler" 498 "inlined_vector" 499 "inlined_vector_internal" 500 "int128" 501 "kernel_timeout_internal" 502 "layout" 503 "leak_check" 504 "log_internal_check_impl" 505 "log_internal_check_op" 506 "log_internal_conditions" 507 "log_internal_config" 508 "log_internal_format" 509 "log_internal_globals" 510 "log_internal_log_impl" 511 "log_internal_proto" 512 "log_internal_message" 513 "log_internal_log_sink_set" 514 "log_internal_nullguard" 515 "log_internal_nullstream" 516 "log_internal_strip" 517 "log_internal_voidify" 518 "log_internal_append_truncated" 519 "log_globals" 520 "log_initialize" 521 "log" 522 "log_entry" 523 "log_sink" 524 "log_sink_registry" 525 "log_streamer" 526 "log_internal_structured" 527 "log_severity" 528 "log_structured" 529 "low_level_hash" 530 "malloc_internal" 531 "memory" 532 "meta" 533 "node_hash_map" 534 "node_hash_set" 535 "node_slot_policy" 536 "non_temporal_arm_intrinsics" 537 "non_temporal_memcpy" 538 "numeric" 539 "optional" 540 "periodic_sampler" 541 "pow10_helper" 542 "pretty_function" 543 "random_bit_gen_ref" 544 "random_distributions" 545 "random_internal_distribution_caller" 546 "random_internal_distributions" 547 "random_internal_explicit_seed_seq" 548 "random_internal_fastmath" 549 "random_internal_fast_uniform_bits" 550 "random_internal_generate_real" 551 "random_internal_iostream_state_saver" 552 "random_internal_nonsecure_base" 553 "random_internal_pcg_engine" 554 "random_internal_platform" 555 "random_internal_pool_urbg" 556 "random_internal_randen" 557 "random_internal_randen_engine" 558 "random_internal_randen_hwaes" 559 "random_internal_randen_hwaes_impl" 560 "random_internal_randen_slow" 561 "random_internal_salted_seed_seq" 562 "random_internal_seed_material" 563 "random_internal_sequence_urbg" 564 "random_internal_traits" 565 "random_internal_uniform_helper" 566 "random_internal_wide_multiply" 567 "random_random" 568 "random_seed_gen_exception" 569 "random_seed_sequences" 570 "raw_hash_map" 571 "raw_hash_set" 572 "raw_logging_internal" 573 "sample_recorder" 574 "scoped_set_env" 575 "span" 576 "spinlock_wait" 577 "spy_hash_state" 578 "stack_consumption" 579 "stacktrace" 580 "status" 581 "statusor" 582 "str_format" 583 "str_format_internal" 584 "strerror" 585 "strings" 586 "strings_internal" 587 "symbolize" 588 "synchronization" 589 "thread_pool" 590 "throw_delegate" 591 "time" 592 "time_zone" 593 "tracked" 594 "type_traits" 595 "utility" 596 "variant" 597) 598 599set(ABSL_INTERNAL_TEST_DLL_FILES 600 "hash/hash_testing.h" 601 "log/scoped_mock_log.cc" 602 "log/scoped_mock_log.h" 603 "random/internal/chi_square.cc" 604 "random/internal/chi_square.h" 605 "random/internal/distribution_test_util.cc" 606 "random/internal/distribution_test_util.h" 607 "random/internal/mock_helpers.h" 608 "random/internal/mock_overload_set.h" 609 "random/mocking_bit_gen.h" 610 "random/mock_distributions.h" 611 "strings/cordz_test_helpers.h" 612 "strings/cord_test_helpers.h" 613) 614 615set(ABSL_INTERNAL_TEST_DLL_TARGETS 616 "cord_test_helpers" 617 "cordz_test_helpers" 618 "hash_testing" 619 "random_mocking_bit_gen" 620 "random_internal_distribution_test_util" 621 "random_internal_mock_overload_set" 622 "scoped_mock_log" 623) 624 625include(CheckCXXSourceCompiles) 626 627check_cxx_source_compiles( 628 [==[ 629#ifdef _MSC_VER 630# if _MSVC_LANG < 201703L 631# error "The compiler defaults or is configured for C++ < 17" 632# endif 633#elif __cplusplus < 201703L 634# error "The compiler defaults or is configured for C++ < 17" 635#endif 636int main() { return 0; } 637]==] 638 ABSL_INTERNAL_AT_LEAST_CXX17) 639 640check_cxx_source_compiles( 641 [==[ 642#ifdef _MSC_VER 643# if _MSVC_LANG < 202002L 644# error "The compiler defaults or is configured for C++ < 20" 645# endif 646#elif __cplusplus < 202002L 647# error "The compiler defaults or is configured for C++ < 20" 648#endif 649int main() { return 0; } 650]==] 651 ABSL_INTERNAL_AT_LEAST_CXX20) 652 653if(ABSL_INTERNAL_AT_LEAST_CXX20) 654 set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20) 655elseif(ABSL_INTERNAL_AT_LEAST_CXX17) 656 set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17) 657else() 658 set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14) 659endif() 660 661function(absl_internal_dll_contains) 662 cmake_parse_arguments(ABSL_INTERNAL_DLL 663 "" 664 "OUTPUT;TARGET" 665 "" 666 ${ARGN} 667 ) 668 669 STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET}) 670 671 list(FIND 672 ABSL_INTERNAL_DLL_TARGETS 673 "${_target}" 674 _index) 675 676 if (${_index} GREATER -1) 677 set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE) 678 else() 679 set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE) 680 endif() 681endfunction() 682 683function(absl_internal_test_dll_contains) 684 cmake_parse_arguments(ABSL_INTERNAL_TEST_DLL 685 "" 686 "OUTPUT;TARGET" 687 "" 688 ${ARGN} 689 ) 690 691 STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_TEST_DLL_TARGET}) 692 693 list(FIND 694 ABSL_INTERNAL_TEST_DLL_TARGETS 695 "${_target}" 696 _index) 697 698 if (${_index} GREATER -1) 699 set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 1 PARENT_SCOPE) 700 else() 701 set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 0 PARENT_SCOPE) 702 endif() 703endfunction() 704 705function(absl_internal_dll_targets) 706 cmake_parse_arguments(ABSL_INTERNAL_DLL 707 "" 708 "OUTPUT" 709 "DEPS" 710 ${ARGN} 711 ) 712 713 set(_deps "") 714 foreach(dep IN LISTS ABSL_INTERNAL_DLL_DEPS) 715 absl_internal_dll_contains(TARGET ${dep} OUTPUT _dll_contains) 716 absl_internal_test_dll_contains(TARGET ${dep} OUTPUT _test_dll_contains) 717 if (_dll_contains) 718 list(APPEND _deps abseil_dll) 719 elseif (_test_dll_contains) 720 list(APPEND _deps abseil_test_dll) 721 else() 722 list(APPEND _deps ${dep}) 723 endif() 724 endforeach() 725 726 # Because we may have added the DLL multiple times 727 list(REMOVE_DUPLICATES _deps) 728 set(${ABSL_INTERNAL_DLL_OUTPUT} "${_deps}" PARENT_SCOPE) 729endfunction() 730 731function(absl_make_dll) 732 cmake_parse_arguments(ABSL_INTERNAL_MAKE_DLL 733 "" 734 "TEST" 735 "" 736 ${ARGN} 737 ) 738 739 if (ABSL_INTERNAL_MAKE_DLL_TEST) 740 set(_dll "abseil_test_dll") 741 set(_dll_files ${ABSL_INTERNAL_TEST_DLL_FILES}) 742 set(_dll_libs "abseil_dll" "GTest::gtest" "GTest::gmock") 743 set(_dll_compile_definitions "GTEST_LINKED_AS_SHARED_LIBRARY=1") 744 set(_dll_includes ${absl_gtest_src_dir}/googletest/include ${absl_gtest_src_dir}/googlemock/include) 745 set(_dll_consume "ABSL_CONSUME_TEST_DLL") 746 set(_dll_build "ABSL_BUILD_TEST_DLL") 747 else() 748 set(_dll "abseil_dll") 749 set(_dll_files ${ABSL_INTERNAL_DLL_FILES}) 750 set(_dll_libs "") 751 set(_dll_compile_definitions "") 752 set(_dll_includes "") 753 set(_dll_consume "ABSL_CONSUME_DLL") 754 set(_dll_build "ABSL_BUILD_DLL") 755 endif() 756 757 add_library( 758 ${_dll} 759 SHARED 760 ${_dll_files} 761 ) 762 target_link_libraries( 763 ${_dll} 764 PRIVATE 765 ${_dll_libs} 766 ${ABSL_DEFAULT_LINKOPTS} 767 ) 768 set_property(TARGET ${_dll} PROPERTY LINKER_LANGUAGE "CXX") 769 target_include_directories( 770 ${_dll} 771 PUBLIC 772 "$<BUILD_INTERFACE:${ABSL_COMMON_INCLUDE_DIRS}>" 773 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> 774 PRIVATE 775 ${_dll_includes} 776 ) 777 778 target_compile_options( 779 ${_dll} 780 PRIVATE 781 ${ABSL_DEFAULT_COPTS} 782 ) 783 784 foreach(cflag ${ABSL_CC_LIB_COPTS}) 785 if(${cflag} MATCHES "^(-Wno|/wd)") 786 # These flags are needed to suppress warnings that might fire in our headers. 787 set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") 788 elseif(${cflag} MATCHES "^(-W|/w[1234eo])") 789 # Don't impose our warnings on others. 790 else() 791 set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") 792 endif() 793 endforeach() 794 string(REPLACE ";" " " PC_LINKOPTS "${ABSL_CC_LIB_LINKOPTS}") 795 796 FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/${_dll}.pc" CONTENT "\ 797prefix=${CMAKE_INSTALL_PREFIX}\n\ 798exec_prefix=\${prefix}\n\ 799libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n\ 800includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n\ 801\n\ 802Name: ${_dll}\n\ 803Description: Abseil DLL library\n\ 804URL: https://abseil.io/\n\ 805Version: ${absl_VERSION}\n\ 806Libs: -L\${libdir} $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-l${_dll}> ${PC_LINKOPTS}\n\ 807Cflags: -I\${includedir}${PC_CFLAGS}\n") 808 INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/${_dll}.pc" 809 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 810 811 target_compile_definitions( 812 ${_dll} 813 PUBLIC 814 ${_dll_compile_definitions} 815 PRIVATE 816 ${_dll_build} 817 NOMINMAX 818 INTERFACE 819 ${ABSL_CC_LIB_DEFINES} 820 ${_dll_consume} 821 ) 822 823 if(ABSL_PROPAGATE_CXX_STD) 824 # Abseil libraries require C++14 as the current minimum standard. When 825 # compiled with a higher minimum (either because it is the compiler's 826 # default or explicitly requested), then Abseil requires that standard. 827 target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE}) 828 endif() 829 830 install(TARGETS ${_dll} EXPORT ${PROJECT_NAME}Targets 831 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 832 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 833 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 834 ) 835 836 add_library(absl::${_dll} ALIAS ${_dll}) 837endfunction() 838