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