• 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/wyhash.h"
128  "hash/internal/wyhash.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_flat.h"
209  "strings/internal/cord_rep_ring.cc"
210  "strings/internal/cord_rep_ring.h"
211  "strings/internal/cord_rep_ring_reader.h"
212  "strings/internal/cordz_functions.cc"
213  "strings/internal/cordz_functions.h"
214  "strings/internal/cordz_handle.cc"
215  "strings/internal/cordz_handle.h"
216  "strings/internal/cordz_info.cc"
217  "strings/internal/cordz_info.h"
218  "strings/internal/cordz_sample_token.cc"
219  "strings/internal/cordz_sample_token.h"
220  "strings/internal/cordz_statistics.h"
221  "strings/internal/cordz_update_scope.h"
222  "strings/internal/cordz_update_tracker.h"
223  "strings/internal/stl_type_traits.h"
224  "strings/internal/string_constant.h"
225  "strings/match.cc"
226  "strings/match.h"
227  "strings/numbers.cc"
228  "strings/numbers.h"
229  "strings/str_format.h"
230  "strings/str_cat.cc"
231  "strings/str_cat.h"
232  "strings/str_join.h"
233  "strings/str_replace.cc"
234  "strings/str_replace.h"
235  "strings/str_split.cc"
236  "strings/str_split.h"
237  "strings/string_view.cc"
238  "strings/string_view.h"
239  "strings/strip.h"
240  "strings/substitute.cc"
241  "strings/substitute.h"
242  "strings/internal/char_map.h"
243  "strings/internal/escaping.h"
244  "strings/internal/escaping.cc"
245  "strings/internal/memutil.cc"
246  "strings/internal/memutil.h"
247  "strings/internal/ostringstream.cc"
248  "strings/internal/ostringstream.h"
249  "strings/internal/pow10_helper.cc"
250  "strings/internal/pow10_helper.h"
251  "strings/internal/resize_uninitialized.h"
252  "strings/internal/str_format/arg.cc"
253  "strings/internal/str_format/arg.h"
254  "strings/internal/str_format/bind.cc"
255  "strings/internal/str_format/bind.h"
256  "strings/internal/str_format/checker.h"
257  "strings/internal/str_format/extension.cc"
258  "strings/internal/str_format/extension.h"
259  "strings/internal/str_format/float_conversion.cc"
260  "strings/internal/str_format/float_conversion.h"
261  "strings/internal/str_format/output.cc"
262  "strings/internal/str_format/output.h"
263  "strings/internal/str_format/parser.cc"
264  "strings/internal/str_format/parser.h"
265  "strings/internal/str_join_internal.h"
266  "strings/internal/str_split_internal.h"
267  "strings/internal/utf8.cc"
268  "strings/internal/utf8.h"
269  "synchronization/barrier.cc"
270  "synchronization/barrier.h"
271  "synchronization/blocking_counter.cc"
272  "synchronization/blocking_counter.h"
273  "synchronization/mutex.cc"
274  "synchronization/mutex.h"
275  "synchronization/notification.cc"
276  "synchronization/notification.h"
277  "synchronization/internal/create_thread_identity.cc"
278  "synchronization/internal/create_thread_identity.h"
279  "synchronization/internal/futex.h"
280  "synchronization/internal/graphcycles.cc"
281  "synchronization/internal/graphcycles.h"
282  "synchronization/internal/kernel_timeout.h"
283  "synchronization/internal/per_thread_sem.cc"
284  "synchronization/internal/per_thread_sem.h"
285  "synchronization/internal/thread_pool.h"
286  "synchronization/internal/waiter.cc"
287  "synchronization/internal/waiter.h"
288  "time/civil_time.cc"
289  "time/civil_time.h"
290  "time/clock.cc"
291  "time/clock.h"
292  "time/duration.cc"
293  "time/format.cc"
294  "time/time.cc"
295  "time/time.h"
296  "time/internal/cctz/include/cctz/civil_time.h"
297  "time/internal/cctz/include/cctz/civil_time_detail.h"
298  "time/internal/cctz/include/cctz/time_zone.h"
299  "time/internal/cctz/include/cctz/zone_info_source.h"
300  "time/internal/cctz/src/civil_time_detail.cc"
301  "time/internal/cctz/src/time_zone_fixed.cc"
302  "time/internal/cctz/src/time_zone_fixed.h"
303  "time/internal/cctz/src/time_zone_format.cc"
304  "time/internal/cctz/src/time_zone_if.cc"
305  "time/internal/cctz/src/time_zone_if.h"
306  "time/internal/cctz/src/time_zone_impl.cc"
307  "time/internal/cctz/src/time_zone_impl.h"
308  "time/internal/cctz/src/time_zone_info.cc"
309  "time/internal/cctz/src/time_zone_info.h"
310  "time/internal/cctz/src/time_zone_libc.cc"
311  "time/internal/cctz/src/time_zone_libc.h"
312  "time/internal/cctz/src/time_zone_lookup.cc"
313  "time/internal/cctz/src/time_zone_posix.cc"
314  "time/internal/cctz/src/time_zone_posix.h"
315  "time/internal/cctz/src/tzfile.h"
316  "time/internal/cctz/src/zone_info_source.cc"
317  "types/any.h"
318  "types/bad_any_cast.cc"
319  "types/bad_any_cast.h"
320  "types/bad_optional_access.cc"
321  "types/bad_optional_access.h"
322  "types/bad_variant_access.cc"
323  "types/bad_variant_access.h"
324  "types/compare.h"
325  "types/internal/conformance_aliases.h"
326  "types/internal/conformance_archetype.h"
327  "types/internal/conformance_profile.h"
328  "types/internal/parentheses.h"
329  "types/internal/transform_args.h"
330  "types/internal/variant.h"
331  "types/optional.h"
332  "types/internal/optional.h"
333  "types/span.h"
334  "types/internal/span.h"
335  "types/variant.h"
336  "utility/utility.h"
337)
338
339set(ABSL_INTERNAL_DLL_TARGETS
340  "stacktrace"
341  "symbolize"
342  "examine_stack"
343  "failure_signal_handler"
344  "debugging_internal"
345  "demangle_internal"
346  "leak_check"
347  "leak_check_disable"
348  "stack_consumption"
349  "debugging"
350  "hash"
351  "spy_hash_state"
352  "city"
353  "memory"
354  "strings"
355  "strings_internal"
356  "cord"
357  "str_format"
358  "str_format_internal"
359  "pow10_helper"
360  "int128"
361  "numeric"
362  "utility"
363  "any"
364  "bad_any_cast"
365  "bad_any_cast_impl"
366  "span"
367  "optional"
368  "bad_optional_access"
369  "bad_variant_access"
370  "variant"
371  "compare"
372  "algorithm"
373  "algorithm_container"
374  "graphcycles_internal"
375  "kernel_timeout_internal"
376  "synchronization"
377  "thread_pool"
378  "bind_front"
379  "function_ref"
380  "atomic_hook"
381  "log_severity"
382  "raw_logging_internal"
383  "spinlock_wait"
384  "config"
385  "dynamic_annotations"
386  "core_headers"
387  "malloc_internal"
388  "base_internal"
389  "base"
390  "throw_delegate"
391  "pretty_function"
392  "endian"
393  "bits"
394  "exponential_biased"
395  "periodic_sampler"
396  "scoped_set_env"
397  "type_traits"
398  "meta"
399  "random_random"
400  "random_bit_gen_ref"
401  "random_distributions"
402  "random_seed_gen_exception"
403  "random_seed_sequences"
404  "random_internal_traits"
405  "random_internal_distribution_caller"
406  "random_internal_distributions"
407  "random_internal_fast_uniform_bits"
408  "random_internal_seed_material"
409  "random_internal_pool_urbg"
410  "random_internal_explicit_seed_seq"
411  "random_internal_sequence_urbg"
412  "random_internal_salted_seed_seq"
413  "random_internal_iostream_state_saver"
414  "random_internal_generate_real"
415  "random_internal_wide_multiply"
416  "random_internal_fastmath"
417  "random_internal_nonsecure_base"
418  "random_internal_pcg_engine"
419  "random_internal_randen_engine"
420  "random_internal_platform"
421  "random_internal_randen"
422  "random_internal_randen_slow"
423  "random_internal_randen_hwaes"
424  "random_internal_randen_hwaes_impl"
425  "random_internal_uniform_helper"
426  "status"
427  "time"
428  "civil_time"
429  "time_zone"
430  "container"
431  "btree"
432  "compressed_tuple"
433  "fixed_array"
434  "inlined_vector_internal"
435  "inlined_vector"
436  "counting_allocator"
437  "flat_hash_map"
438  "flat_hash_set"
439  "node_hash_map"
440  "node_hash_set"
441  "container_memory"
442  "hash_function_defaults"
443  "hash_policy_traits"
444  "hashtablez_sampler"
445  "hashtable_debug"
446  "hashtable_debug_hooks"
447  "have_sse"
448  "node_hash_policy"
449  "raw_hash_map"
450  "container_common"
451  "raw_hash_set"
452  "layout"
453  "tracked"
454)
455
456function(absl_internal_dll_contains)
457  cmake_parse_arguments(ABSL_INTERNAL_DLL
458    ""
459    "OUTPUT;TARGET"
460    ""
461    ${ARGN}
462  )
463
464  STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET})
465
466  list(FIND
467    ABSL_INTERNAL_DLL_TARGETS
468    "${_target}"
469    _index)
470
471  if (${_index} GREATER -1)
472    set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE)
473  else()
474    set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE)
475  endif()
476endfunction()
477
478function(absl_internal_dll_targets)
479  cmake_parse_arguments(ABSL_INTERNAL_DLL
480  ""
481  "OUTPUT"
482  "DEPS"
483  ${ARGN}
484  )
485
486  set(_deps "")
487  foreach(dep IN LISTS ABSL_INTERNAL_DLL_DEPS)
488    absl_internal_dll_contains(TARGET ${dep} OUTPUT _contains)
489    if (_contains)
490      list(APPEND _deps abseil_dll)
491    else()
492      list(APPEND _deps ${dep})
493    endif()
494  endforeach()
495
496  # Because we may have added the DLL multiple times
497  list(REMOVE_DUPLICATES _deps)
498  set(${ABSL_INTERNAL_DLL_OUTPUT} "${_deps}" PARENT_SCOPE)
499endfunction()
500
501function(absl_make_dll)
502  add_library(
503    abseil_dll
504    SHARED
505      "${ABSL_INTERNAL_DLL_FILES}"
506  )
507  target_link_libraries(
508    abseil_dll
509    PRIVATE
510      ${ABSL_DEFAULT_LINKOPTS}
511  )
512  set_property(TARGET abseil_dll PROPERTY LINKER_LANGUAGE "CXX")
513  target_include_directories(
514    abseil_dll
515    PUBLIC
516      "$<BUILD_INTERFACE:${ABSL_COMMON_INCLUDE_DIRS}>"
517      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
518  )
519
520  target_compile_options(
521    abseil_dll
522    PRIVATE
523      ${ABSL_DEFAULT_COPTS}
524  )
525
526  target_compile_definitions(
527    abseil_dll
528    PRIVATE
529      ABSL_BUILD_DLL
530      NOMINMAX
531    INTERFACE
532      ${ABSL_CC_LIB_DEFINES}
533  )
534  install(TARGETS abseil_dll EXPORT ${PROJECT_NAME}Targets
535        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
536        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
537        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
538  )
539endfunction()
540