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