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