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