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/direct_mmap.h" 17 "base/internal/dynamic_annotations.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/per_thread_tls.h" 29 "base/internal/pretty_function.h" 30 "base/internal/raw_logging.cc" 31 "base/internal/raw_logging.h" 32 "base/internal/scheduling_mode.h" 33 "base/internal/scoped_set_env.cc" 34 "base/internal/scoped_set_env.h" 35 "base/internal/strerror.h" 36 "base/internal/strerror.cc" 37 "base/internal/spinlock.cc" 38 "base/internal/spinlock.h" 39 "base/internal/spinlock_wait.cc" 40 "base/internal/spinlock_wait.h" 41 "base/internal/sysinfo.cc" 42 "base/internal/sysinfo.h" 43 "base/internal/thread_annotations.h" 44 "base/internal/thread_identity.cc" 45 "base/internal/thread_identity.h" 46 "base/internal/throw_delegate.cc" 47 "base/internal/throw_delegate.h" 48 "base/internal/tsan_mutex_interface.h" 49 "base/internal/unaligned_access.h" 50 "base/internal/unscaledcycleclock.cc" 51 "base/internal/unscaledcycleclock.h" 52 "base/log_severity.cc" 53 "base/log_severity.h" 54 "base/macros.h" 55 "base/optimization.h" 56 "base/options.h" 57 "base/policy_checks.h" 58 "base/port.h" 59 "base/thread_annotations.h" 60 "cleanup/cleanup.h" 61 "cleanup/internal/cleanup.h" 62 "container/btree_map.h" 63 "container/btree_set.h" 64 "container/fixed_array.h" 65 "container/flat_hash_map.h" 66 "container/flat_hash_set.h" 67 "container/inlined_vector.h" 68 "container/internal/btree.h" 69 "container/internal/btree_container.h" 70 "container/internal/common.h" 71 "container/internal/compressed_tuple.h" 72 "container/internal/container_memory.h" 73 "container/internal/counting_allocator.h" 74 "container/internal/hash_function_defaults.h" 75 "container/internal/hash_policy_traits.h" 76 "container/internal/hashtable_debug.h" 77 "container/internal/hashtable_debug_hooks.h" 78 "container/internal/hashtablez_sampler.cc" 79 "container/internal/hashtablez_sampler.h" 80 "container/internal/hashtablez_sampler_force_weak_definition.cc" 81 "container/internal/have_sse.h" 82 "container/internal/inlined_vector.h" 83 "container/internal/layout.h" 84 "container/internal/node_hash_policy.h" 85 "container/internal/raw_hash_map.h" 86 "container/internal/raw_hash_set.cc" 87 "container/internal/raw_hash_set.h" 88 "container/internal/tracked.h" 89 "container/node_hash_map.h" 90 "container/node_hash_set.h" 91 "debugging/failure_signal_handler.cc" 92 "debugging/failure_signal_handler.h" 93 "debugging/leak_check.h" 94 "debugging/leak_check_disable.cc" 95 "debugging/stacktrace.cc" 96 "debugging/stacktrace.h" 97 "debugging/symbolize.cc" 98 "debugging/symbolize.h" 99 "debugging/internal/address_is_readable.cc" 100 "debugging/internal/address_is_readable.h" 101 "debugging/internal/demangle.cc" 102 "debugging/internal/demangle.h" 103 "debugging/internal/elf_mem_image.cc" 104 "debugging/internal/elf_mem_image.h" 105 "debugging/internal/examine_stack.cc" 106 "debugging/internal/examine_stack.h" 107 "debugging/internal/stack_consumption.cc" 108 "debugging/internal/stack_consumption.h" 109 "debugging/internal/stacktrace_config.h" 110 "debugging/internal/symbolize.h" 111 "debugging/internal/vdso_support.cc" 112 "debugging/internal/vdso_support.h" 113 "functional/internal/front_binder.h" 114 "functional/bind_front.h" 115 "functional/function_ref.h" 116 "functional/internal/function_ref.h" 117 "hash/hash.h" 118 "hash/internal/city.h" 119 "hash/internal/city.cc" 120 "hash/internal/hash.h" 121 "hash/internal/hash.cc" 122 "hash/internal/spy_hash_state.h" 123 "hash/internal/low_level_hash.h" 124 "hash/internal/low_level_hash.cc" 125 "memory/memory.h" 126 "meta/type_traits.h" 127 "numeric/bits.h" 128 "numeric/int128.cc" 129 "numeric/int128.h" 130 "numeric/internal/bits.h" 131 "numeric/internal/representation.h" 132 "profiling/internal/exponential_biased.cc" 133 "profiling/internal/exponential_biased.h" 134 "profiling/internal/periodic_sampler.cc" 135 "profiling/internal/periodic_sampler.h" 136 "profiling/internal/sample_recorder.h" 137 "random/bernoulli_distribution.h" 138 "random/beta_distribution.h" 139 "random/bit_gen_ref.h" 140 "random/discrete_distribution.cc" 141 "random/discrete_distribution.h" 142 "random/distributions.h" 143 "random/exponential_distribution.h" 144 "random/gaussian_distribution.cc" 145 "random/gaussian_distribution.h" 146 "random/internal/distribution_caller.h" 147 "random/internal/fastmath.h" 148 "random/internal/fast_uniform_bits.h" 149 "random/internal/generate_real.h" 150 "random/internal/iostream_state_saver.h" 151 "random/internal/mock_helpers.h" 152 "random/internal/nonsecure_base.h" 153 "random/internal/pcg_engine.h" 154 "random/internal/platform.h" 155 "random/internal/pool_urbg.cc" 156 "random/internal/pool_urbg.h" 157 "random/internal/randen.cc" 158 "random/internal/randen.h" 159 "random/internal/randen_detect.cc" 160 "random/internal/randen_detect.h" 161 "random/internal/randen_engine.h" 162 "random/internal/randen_hwaes.cc" 163 "random/internal/randen_hwaes.h" 164 "random/internal/randen_round_keys.cc" 165 "random/internal/randen_slow.cc" 166 "random/internal/randen_slow.h" 167 "random/internal/randen_traits.h" 168 "random/internal/salted_seed_seq.h" 169 "random/internal/seed_material.cc" 170 "random/internal/seed_material.h" 171 "random/internal/sequence_urbg.h" 172 "random/internal/traits.h" 173 "random/internal/uniform_helper.h" 174 "random/internal/wide_multiply.h" 175 "random/log_uniform_int_distribution.h" 176 "random/poisson_distribution.h" 177 "random/random.h" 178 "random/seed_gen_exception.cc" 179 "random/seed_gen_exception.h" 180 "random/seed_sequences.cc" 181 "random/seed_sequences.h" 182 "random/uniform_int_distribution.h" 183 "random/uniform_real_distribution.h" 184 "random/zipf_distribution.h" 185 "status/internal/status_internal.h" 186 "status/internal/statusor_internal.h" 187 "status/status.h" 188 "status/status.cc" 189 "status/statusor.h" 190 "status/statusor.cc" 191 "status/status_payload_printer.h" 192 "status/status_payload_printer.cc" 193 "strings/ascii.cc" 194 "strings/ascii.h" 195 "strings/charconv.cc" 196 "strings/charconv.h" 197 "strings/cord.cc" 198 "strings/cord.h" 199 "strings/escaping.cc" 200 "strings/escaping.h" 201 "strings/internal/charconv_bigint.cc" 202 "strings/internal/charconv_bigint.h" 203 "strings/internal/charconv_parse.cc" 204 "strings/internal/charconv_parse.h" 205 "strings/internal/cord_internal.cc" 206 "strings/internal/cord_internal.h" 207 "strings/internal/cord_rep_consume.h" 208 "strings/internal/cord_rep_consume.cc" 209 "strings/internal/cord_rep_btree.cc" 210 "strings/internal/cord_rep_btree.h" 211 "strings/internal/cord_rep_btree_navigator.cc" 212 "strings/internal/cord_rep_btree_navigator.h" 213 "strings/internal/cord_rep_btree_reader.cc" 214 "strings/internal/cord_rep_btree_reader.h" 215 "strings/internal/cord_rep_flat.h" 216 "strings/internal/cord_rep_ring.cc" 217 "strings/internal/cord_rep_ring.h" 218 "strings/internal/cord_rep_ring_reader.h" 219 "strings/internal/cordz_functions.cc" 220 "strings/internal/cordz_functions.h" 221 "strings/internal/cordz_handle.cc" 222 "strings/internal/cordz_handle.h" 223 "strings/internal/cordz_info.cc" 224 "strings/internal/cordz_info.h" 225 "strings/internal/cordz_sample_token.cc" 226 "strings/internal/cordz_sample_token.h" 227 "strings/internal/cordz_statistics.h" 228 "strings/internal/cordz_update_scope.h" 229 "strings/internal/cordz_update_tracker.h" 230 "strings/internal/stl_type_traits.h" 231 "strings/internal/string_constant.h" 232 "strings/match.cc" 233 "strings/match.h" 234 "strings/numbers.cc" 235 "strings/numbers.h" 236 "strings/str_format.h" 237 "strings/str_cat.cc" 238 "strings/str_cat.h" 239 "strings/str_join.h" 240 "strings/str_replace.cc" 241 "strings/str_replace.h" 242 "strings/str_split.cc" 243 "strings/str_split.h" 244 "strings/string_view.cc" 245 "strings/string_view.h" 246 "strings/strip.h" 247 "strings/substitute.cc" 248 "strings/substitute.h" 249 "strings/internal/char_map.h" 250 "strings/internal/escaping.h" 251 "strings/internal/escaping.cc" 252 "strings/internal/memutil.cc" 253 "strings/internal/memutil.h" 254 "strings/internal/ostringstream.cc" 255 "strings/internal/ostringstream.h" 256 "strings/internal/pow10_helper.cc" 257 "strings/internal/pow10_helper.h" 258 "strings/internal/resize_uninitialized.h" 259 "strings/internal/str_format/arg.cc" 260 "strings/internal/str_format/arg.h" 261 "strings/internal/str_format/bind.cc" 262 "strings/internal/str_format/bind.h" 263 "strings/internal/str_format/checker.h" 264 "strings/internal/str_format/extension.cc" 265 "strings/internal/str_format/extension.h" 266 "strings/internal/str_format/float_conversion.cc" 267 "strings/internal/str_format/float_conversion.h" 268 "strings/internal/str_format/output.cc" 269 "strings/internal/str_format/output.h" 270 "strings/internal/str_format/parser.cc" 271 "strings/internal/str_format/parser.h" 272 "strings/internal/str_join_internal.h" 273 "strings/internal/str_split_internal.h" 274 "strings/internal/utf8.cc" 275 "strings/internal/utf8.h" 276 "synchronization/barrier.cc" 277 "synchronization/barrier.h" 278 "synchronization/blocking_counter.cc" 279 "synchronization/blocking_counter.h" 280 "synchronization/mutex.cc" 281 "synchronization/mutex.h" 282 "synchronization/notification.cc" 283 "synchronization/notification.h" 284 "synchronization/internal/create_thread_identity.cc" 285 "synchronization/internal/create_thread_identity.h" 286 "synchronization/internal/futex.h" 287 "synchronization/internal/graphcycles.cc" 288 "synchronization/internal/graphcycles.h" 289 "synchronization/internal/kernel_timeout.h" 290 "synchronization/internal/per_thread_sem.cc" 291 "synchronization/internal/per_thread_sem.h" 292 "synchronization/internal/thread_pool.h" 293 "synchronization/internal/waiter.cc" 294 "synchronization/internal/waiter.h" 295 "time/civil_time.cc" 296 "time/civil_time.h" 297 "time/clock.cc" 298 "time/clock.h" 299 "time/duration.cc" 300 "time/format.cc" 301 "time/time.cc" 302 "time/time.h" 303 "time/internal/cctz/include/cctz/civil_time.h" 304 "time/internal/cctz/include/cctz/civil_time_detail.h" 305 "time/internal/cctz/include/cctz/time_zone.h" 306 "time/internal/cctz/include/cctz/zone_info_source.h" 307 "time/internal/cctz/src/civil_time_detail.cc" 308 "time/internal/cctz/src/time_zone_fixed.cc" 309 "time/internal/cctz/src/time_zone_fixed.h" 310 "time/internal/cctz/src/time_zone_format.cc" 311 "time/internal/cctz/src/time_zone_if.cc" 312 "time/internal/cctz/src/time_zone_if.h" 313 "time/internal/cctz/src/time_zone_impl.cc" 314 "time/internal/cctz/src/time_zone_impl.h" 315 "time/internal/cctz/src/time_zone_info.cc" 316 "time/internal/cctz/src/time_zone_info.h" 317 "time/internal/cctz/src/time_zone_libc.cc" 318 "time/internal/cctz/src/time_zone_libc.h" 319 "time/internal/cctz/src/time_zone_lookup.cc" 320 "time/internal/cctz/src/time_zone_posix.cc" 321 "time/internal/cctz/src/time_zone_posix.h" 322 "time/internal/cctz/src/tzfile.h" 323 "time/internal/cctz/src/zone_info_source.cc" 324 "types/any.h" 325 "types/bad_any_cast.cc" 326 "types/bad_any_cast.h" 327 "types/bad_optional_access.cc" 328 "types/bad_optional_access.h" 329 "types/bad_variant_access.cc" 330 "types/bad_variant_access.h" 331 "types/compare.h" 332 "types/internal/conformance_aliases.h" 333 "types/internal/conformance_archetype.h" 334 "types/internal/conformance_profile.h" 335 "types/internal/parentheses.h" 336 "types/internal/transform_args.h" 337 "types/internal/variant.h" 338 "types/optional.h" 339 "types/internal/optional.h" 340 "types/span.h" 341 "types/internal/span.h" 342 "types/variant.h" 343 "utility/utility.h" 344) 345 346set(ABSL_INTERNAL_DLL_TARGETS 347 "stacktrace" 348 "symbolize" 349 "examine_stack" 350 "failure_signal_handler" 351 "debugging_internal" 352 "demangle_internal" 353 "leak_check" 354 "leak_check_disable" 355 "stack_consumption" 356 "debugging" 357 "hash" 358 "spy_hash_state" 359 "city" 360 "memory" 361 "strings" 362 "strings_internal" 363 "cord" 364 "str_format" 365 "str_format_internal" 366 "pow10_helper" 367 "int128" 368 "numeric" 369 "utility" 370 "any" 371 "bad_any_cast" 372 "bad_any_cast_impl" 373 "span" 374 "optional" 375 "bad_optional_access" 376 "bad_variant_access" 377 "variant" 378 "compare" 379 "algorithm" 380 "algorithm_container" 381 "graphcycles_internal" 382 "kernel_timeout_internal" 383 "synchronization" 384 "thread_pool" 385 "bind_front" 386 "function_ref" 387 "atomic_hook" 388 "log_severity" 389 "raw_logging_internal" 390 "spinlock_wait" 391 "config" 392 "dynamic_annotations" 393 "core_headers" 394 "malloc_internal" 395 "base_internal" 396 "base" 397 "throw_delegate" 398 "pretty_function" 399 "endian" 400 "bits" 401 "exponential_biased" 402 "periodic_sampler" 403 "scoped_set_env" 404 "type_traits" 405 "meta" 406 "random_random" 407 "random_bit_gen_ref" 408 "random_distributions" 409 "random_seed_gen_exception" 410 "random_seed_sequences" 411 "random_internal_traits" 412 "random_internal_distribution_caller" 413 "random_internal_distributions" 414 "random_internal_fast_uniform_bits" 415 "random_internal_seed_material" 416 "random_internal_pool_urbg" 417 "random_internal_explicit_seed_seq" 418 "random_internal_sequence_urbg" 419 "random_internal_salted_seed_seq" 420 "random_internal_iostream_state_saver" 421 "random_internal_generate_real" 422 "random_internal_wide_multiply" 423 "random_internal_fastmath" 424 "random_internal_nonsecure_base" 425 "random_internal_pcg_engine" 426 "random_internal_randen_engine" 427 "random_internal_platform" 428 "random_internal_randen" 429 "random_internal_randen_slow" 430 "random_internal_randen_hwaes" 431 "random_internal_randen_hwaes_impl" 432 "random_internal_uniform_helper" 433 "status" 434 "time" 435 "civil_time" 436 "time_zone" 437 "container" 438 "btree" 439 "compressed_tuple" 440 "fixed_array" 441 "inlined_vector_internal" 442 "inlined_vector" 443 "counting_allocator" 444 "flat_hash_map" 445 "flat_hash_set" 446 "node_hash_map" 447 "node_hash_set" 448 "container_memory" 449 "hash_function_defaults" 450 "hash_policy_traits" 451 "hashtablez_sampler" 452 "hashtable_debug" 453 "hashtable_debug_hooks" 454 "have_sse" 455 "node_hash_policy" 456 "raw_hash_map" 457 "container_common" 458 "raw_hash_set" 459 "layout" 460 "tracked" 461 "sample_recorder" 462) 463 464function(absl_internal_dll_contains) 465 cmake_parse_arguments(ABSL_INTERNAL_DLL 466 "" 467 "OUTPUT;TARGET" 468 "" 469 ${ARGN} 470 ) 471 472 STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET}) 473 474 list(FIND 475 ABSL_INTERNAL_DLL_TARGETS 476 "${_target}" 477 _index) 478 479 if (${_index} GREATER -1) 480 set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE) 481 else() 482 set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE) 483 endif() 484endfunction() 485 486function(absl_internal_dll_targets) 487 cmake_parse_arguments(ABSL_INTERNAL_DLL 488 "" 489 "OUTPUT" 490 "DEPS" 491 ${ARGN} 492 ) 493 494 set(_deps "") 495 foreach(dep IN LISTS ABSL_INTERNAL_DLL_DEPS) 496 absl_internal_dll_contains(TARGET ${dep} OUTPUT _contains) 497 if (_contains) 498 list(APPEND _deps abseil_dll) 499 else() 500 list(APPEND _deps ${dep}) 501 endif() 502 endforeach() 503 504 # Because we may have added the DLL multiple times 505 list(REMOVE_DUPLICATES _deps) 506 set(${ABSL_INTERNAL_DLL_OUTPUT} "${_deps}" PARENT_SCOPE) 507endfunction() 508 509function(absl_make_dll) 510 add_library( 511 abseil_dll 512 SHARED 513 "${ABSL_INTERNAL_DLL_FILES}" 514 ) 515 target_link_libraries( 516 abseil_dll 517 PRIVATE 518 ${ABSL_DEFAULT_LINKOPTS} 519 ) 520 set_property(TARGET abseil_dll PROPERTY LINKER_LANGUAGE "CXX") 521 target_include_directories( 522 abseil_dll 523 PUBLIC 524 "$<BUILD_INTERFACE:${ABSL_COMMON_INCLUDE_DIRS}>" 525 $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> 526 ) 527 528 target_compile_options( 529 abseil_dll 530 PRIVATE 531 ${ABSL_DEFAULT_COPTS} 532 ) 533 534 target_compile_definitions( 535 abseil_dll 536 PRIVATE 537 ABSL_BUILD_DLL 538 NOMINMAX 539 INTERFACE 540 ${ABSL_CC_LIB_DEFINES} 541 ) 542 install(TARGETS abseil_dll EXPORT ${PROJECT_NAME}Targets 543 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 544 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 545 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 546 ) 547endfunction() 548