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