• 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/cycleclock_config.h"
17  "base/internal/direct_mmap.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/nullability_impl.h"
29  "base/internal/per_thread_tls.h"
30  "base/internal/prefetch.h"
31  "base/prefetch.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/strerror.h"
39  "base/internal/strerror.cc"
40  "base/internal/spinlock.cc"
41  "base/internal/spinlock.h"
42  "base/internal/spinlock_wait.cc"
43  "base/internal/spinlock_wait.h"
44  "base/internal/sysinfo.cc"
45  "base/internal/sysinfo.h"
46  "base/internal/thread_identity.cc"
47  "base/internal/thread_identity.h"
48  "base/internal/throw_delegate.cc"
49  "base/internal/throw_delegate.h"
50  "base/internal/tsan_mutex_interface.h"
51  "base/internal/unaligned_access.h"
52  "base/internal/unscaledcycleclock.cc"
53  "base/internal/unscaledcycleclock.h"
54  "base/internal/unscaledcycleclock_config.h"
55  "base/log_severity.cc"
56  "base/log_severity.h"
57  "base/macros.h"
58  "base/nullability.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/common_policy_traits.h"
76  "container/internal/compressed_tuple.h"
77  "container/internal/container_memory.h"
78  "container/internal/counting_allocator.h"
79  "container/internal/hash_function_defaults.h"
80  "container/internal/hash_policy_traits.h"
81  "container/internal/hashtable_debug.h"
82  "container/internal/hashtable_debug_hooks.h"
83  "container/internal/hashtablez_sampler.cc"
84  "container/internal/hashtablez_sampler.h"
85  "container/internal/hashtablez_sampler_force_weak_definition.cc"
86  "container/internal/inlined_vector.h"
87  "container/internal/layout.h"
88  "container/internal/node_slot_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  "crc/crc32c.cc"
96  "crc/crc32c.h"
97  "crc/internal/cpu_detect.cc"
98  "crc/internal/cpu_detect.h"
99  "crc/internal/crc32c.h"
100  "crc/internal/crc32c_inline.h"
101  "crc/internal/crc32_x86_arm_combined_simd.h"
102  "crc/internal/crc.cc"
103  "crc/internal/crc.h"
104  "crc/internal/crc_cord_state.cc"
105  "crc/internal/crc_cord_state.h"
106  "crc/internal/crc_internal.h"
107  "crc/internal/crc_x86_arm_combined.cc"
108  "crc/internal/crc_memcpy_fallback.cc"
109  "crc/internal/crc_memcpy.h"
110  "crc/internal/crc_memcpy_x86_64.cc"
111  "crc/internal/crc_non_temporal_memcpy.cc"
112  "crc/internal/crc_x86_arm_combined.cc"
113  "crc/internal/non_temporal_arm_intrinsics.h"
114  "crc/internal/non_temporal_memcpy.h"
115  "debugging/failure_signal_handler.cc"
116  "debugging/failure_signal_handler.h"
117  "debugging/leak_check.h"
118  "debugging/stacktrace.cc"
119  "debugging/stacktrace.h"
120  "debugging/symbolize.cc"
121  "debugging/symbolize.h"
122  "debugging/internal/address_is_readable.cc"
123  "debugging/internal/address_is_readable.h"
124  "debugging/internal/demangle.cc"
125  "debugging/internal/demangle.h"
126  "debugging/internal/elf_mem_image.cc"
127  "debugging/internal/elf_mem_image.h"
128  "debugging/internal/examine_stack.cc"
129  "debugging/internal/examine_stack.h"
130  "debugging/internal/stack_consumption.cc"
131  "debugging/internal/stack_consumption.h"
132  "debugging/internal/stacktrace_config.h"
133  "debugging/internal/symbolize.h"
134  "debugging/internal/vdso_support.cc"
135  "debugging/internal/vdso_support.h"
136  "functional/any_invocable.h"
137  "functional/internal/front_binder.h"
138  "functional/bind_front.h"
139  "functional/function_ref.h"
140  "functional/internal/any_invocable.h"
141  "functional/internal/function_ref.h"
142  "hash/hash.h"
143  "hash/internal/city.h"
144  "hash/internal/city.cc"
145  "hash/internal/hash.h"
146  "hash/internal/hash.cc"
147  "hash/internal/spy_hash_state.h"
148  "hash/internal/low_level_hash.h"
149  "hash/internal/low_level_hash.cc"
150  "log/absl_check.h"
151  "log/absl_log.h"
152  "log/check.h"
153  "log/die_if_null.cc"
154  "log/die_if_null.h"
155  "log/globals.cc"
156  "log/globals.h"
157  "log/internal/append_truncated.h"
158  "log/internal/check_impl.h"
159  "log/internal/check_op.cc"
160  "log/internal/check_op.h"
161  "log/internal/conditions.cc"
162  "log/internal/conditions.h"
163  "log/internal/config.h"
164  "log/internal/globals.cc"
165  "log/internal/globals.h"
166  "log/internal/log_format.cc"
167  "log/internal/log_format.h"
168  "log/internal/log_impl.h"
169  "log/internal/log_message.cc"
170  "log/internal/log_message.h"
171  "log/internal/log_sink_set.cc"
172  "log/internal/log_sink_set.h"
173  "log/internal/nullguard.cc"
174  "log/internal/nullguard.h"
175  "log/internal/nullstream.h"
176  "log/internal/proto.h"
177  "log/internal/proto.cc"
178  "log/internal/strip.h"
179  "log/internal/structured.h"
180  "log/internal/voidify.h"
181  "log/initialize.cc"
182  "log/initialize.h"
183  "log/log.h"
184  "log/log_entry.cc"
185  "log/log_entry.h"
186  "log/log_sink.cc"
187  "log/log_sink.h"
188  "log/log_sink_registry.h"
189  "log/log_streamer.h"
190  "log/structured.h"
191  "memory/memory.h"
192  "meta/type_traits.h"
193  "numeric/bits.h"
194  "numeric/int128.cc"
195  "numeric/int128.h"
196  "numeric/internal/bits.h"
197  "numeric/internal/representation.h"
198  "profiling/internal/exponential_biased.cc"
199  "profiling/internal/exponential_biased.h"
200  "profiling/internal/periodic_sampler.cc"
201  "profiling/internal/periodic_sampler.h"
202  "profiling/internal/sample_recorder.h"
203  "random/bernoulli_distribution.h"
204  "random/beta_distribution.h"
205  "random/bit_gen_ref.h"
206  "random/discrete_distribution.cc"
207  "random/discrete_distribution.h"
208  "random/distributions.h"
209  "random/exponential_distribution.h"
210  "random/gaussian_distribution.cc"
211  "random/gaussian_distribution.h"
212  "random/internal/distribution_caller.h"
213  "random/internal/fastmath.h"
214  "random/internal/fast_uniform_bits.h"
215  "random/internal/generate_real.h"
216  "random/internal/iostream_state_saver.h"
217  "random/internal/nonsecure_base.h"
218  "random/internal/pcg_engine.h"
219  "random/internal/platform.h"
220  "random/internal/pool_urbg.cc"
221  "random/internal/pool_urbg.h"
222  "random/internal/randen.cc"
223  "random/internal/randen.h"
224  "random/internal/randen_detect.cc"
225  "random/internal/randen_detect.h"
226  "random/internal/randen_engine.h"
227  "random/internal/randen_hwaes.cc"
228  "random/internal/randen_hwaes.h"
229  "random/internal/randen_round_keys.cc"
230  "random/internal/randen_slow.cc"
231  "random/internal/randen_slow.h"
232  "random/internal/randen_traits.h"
233  "random/internal/salted_seed_seq.h"
234  "random/internal/seed_material.cc"
235  "random/internal/seed_material.h"
236  "random/internal/sequence_urbg.h"
237  "random/internal/traits.h"
238  "random/internal/uniform_helper.h"
239  "random/internal/wide_multiply.h"
240  "random/log_uniform_int_distribution.h"
241  "random/poisson_distribution.h"
242  "random/random.h"
243  "random/seed_gen_exception.cc"
244  "random/seed_gen_exception.h"
245  "random/seed_sequences.cc"
246  "random/seed_sequences.h"
247  "random/uniform_int_distribution.h"
248  "random/uniform_real_distribution.h"
249  "random/zipf_distribution.h"
250  "status/internal/status_internal.h"
251  "status/internal/statusor_internal.h"
252  "status/status.h"
253  "status/status.cc"
254  "status/statusor.h"
255  "status/statusor.cc"
256  "status/status_payload_printer.h"
257  "status/status_payload_printer.cc"
258  "strings/ascii.cc"
259  "strings/ascii.h"
260  "strings/charconv.cc"
261  "strings/charconv.h"
262  "strings/cord.cc"
263  "strings/cord.h"
264  "strings/cord_analysis.cc"
265  "strings/cord_analysis.h"
266  "strings/cord_buffer.cc"
267  "strings/cord_buffer.h"
268  "strings/escaping.cc"
269  "strings/escaping.h"
270  "strings/internal/charconv_bigint.cc"
271  "strings/internal/charconv_bigint.h"
272  "strings/internal/charconv_parse.cc"
273  "strings/internal/charconv_parse.h"
274  "strings/internal/cord_data_edge.h"
275  "strings/internal/cord_internal.cc"
276  "strings/internal/cord_internal.h"
277  "strings/internal/cord_rep_btree.cc"
278  "strings/internal/cord_rep_btree.h"
279  "strings/internal/cord_rep_btree_navigator.cc"
280  "strings/internal/cord_rep_btree_navigator.h"
281  "strings/internal/cord_rep_btree_reader.cc"
282  "strings/internal/cord_rep_btree_reader.h"
283  "strings/internal/cord_rep_crc.cc"
284  "strings/internal/cord_rep_crc.h"
285  "strings/internal/cord_rep_consume.h"
286  "strings/internal/cord_rep_consume.cc"
287  "strings/internal/cord_rep_flat.h"
288  "strings/internal/cord_rep_ring.cc"
289  "strings/internal/cord_rep_ring.h"
290  "strings/internal/cord_rep_ring_reader.h"
291  "strings/internal/cordz_functions.cc"
292  "strings/internal/cordz_functions.h"
293  "strings/internal/cordz_handle.cc"
294  "strings/internal/cordz_handle.h"
295  "strings/internal/cordz_info.cc"
296  "strings/internal/cordz_info.h"
297  "strings/internal/cordz_sample_token.cc"
298  "strings/internal/cordz_sample_token.h"
299  "strings/internal/cordz_statistics.h"
300  "strings/internal/cordz_update_scope.h"
301  "strings/internal/cordz_update_tracker.h"
302  "strings/internal/damerau_levenshtein_distance.h"
303  "strings/internal/damerau_levenshtein_distance.cc"
304  "strings/internal/stl_type_traits.h"
305  "strings/internal/string_constant.h"
306  "strings/internal/stringify_sink.h"
307  "strings/internal/stringify_sink.cc"
308  "strings/internal/has_absl_stringify.h"
309  "strings/match.cc"
310  "strings/match.h"
311  "strings/numbers.cc"
312  "strings/numbers.h"
313  "strings/str_format.h"
314  "strings/str_cat.cc"
315  "strings/str_cat.h"
316  "strings/str_join.h"
317  "strings/str_replace.cc"
318  "strings/str_replace.h"
319  "strings/str_split.cc"
320  "strings/str_split.h"
321  "strings/string_view.cc"
322  "strings/string_view.h"
323  "strings/strip.h"
324  "strings/substitute.cc"
325  "strings/substitute.h"
326  "strings/internal/char_map.h"
327  "strings/internal/escaping.h"
328  "strings/internal/escaping.cc"
329  "strings/internal/memutil.cc"
330  "strings/internal/memutil.h"
331  "strings/internal/ostringstream.cc"
332  "strings/internal/ostringstream.h"
333  "strings/internal/pow10_helper.cc"
334  "strings/internal/pow10_helper.h"
335  "strings/internal/resize_uninitialized.h"
336  "strings/internal/str_format/arg.cc"
337  "strings/internal/str_format/arg.h"
338  "strings/internal/str_format/bind.cc"
339  "strings/internal/str_format/bind.h"
340  "strings/internal/str_format/checker.h"
341  "strings/internal/str_format/constexpr_parser.h"
342  "strings/internal/str_format/extension.cc"
343  "strings/internal/str_format/extension.h"
344  "strings/internal/str_format/float_conversion.cc"
345  "strings/internal/str_format/float_conversion.h"
346  "strings/internal/str_format/output.cc"
347  "strings/internal/str_format/output.h"
348  "strings/internal/str_format/parser.cc"
349  "strings/internal/str_format/parser.h"
350  "strings/internal/str_join_internal.h"
351  "strings/internal/str_split_internal.h"
352  "strings/internal/utf8.cc"
353  "strings/internal/utf8.h"
354  "synchronization/barrier.cc"
355  "synchronization/barrier.h"
356  "synchronization/blocking_counter.cc"
357  "synchronization/blocking_counter.h"
358  "synchronization/mutex.cc"
359  "synchronization/mutex.h"
360  "synchronization/notification.cc"
361  "synchronization/notification.h"
362  "synchronization/internal/create_thread_identity.cc"
363  "synchronization/internal/create_thread_identity.h"
364  "synchronization/internal/futex.h"
365  "synchronization/internal/futex_waiter.h"
366  "synchronization/internal/futex_waiter.cc"
367  "synchronization/internal/graphcycles.cc"
368  "synchronization/internal/graphcycles.h"
369  "synchronization/internal/kernel_timeout.h"
370  "synchronization/internal/kernel_timeout.cc"
371  "synchronization/internal/per_thread_sem.cc"
372  "synchronization/internal/per_thread_sem.h"
373  "synchronization/internal/pthread_waiter.h"
374  "synchronization/internal/pthread_waiter.cc"
375  "synchronization/internal/sem_waiter.h"
376  "synchronization/internal/sem_waiter.cc"
377  "synchronization/internal/stdcpp_waiter.h"
378  "synchronization/internal/stdcpp_waiter.cc"
379  "synchronization/internal/thread_pool.h"
380  "synchronization/internal/waiter.h"
381  "synchronization/internal/waiter_base.h"
382  "synchronization/internal/waiter_base.cc"
383  "synchronization/internal/win32_waiter.h"
384  "synchronization/internal/win32_waiter.cc"
385  "time/civil_time.cc"
386  "time/civil_time.h"
387  "time/clock.cc"
388  "time/clock.h"
389  "time/duration.cc"
390  "time/format.cc"
391  "time/time.cc"
392  "time/time.h"
393  "time/internal/cctz/include/cctz/civil_time.h"
394  "time/internal/cctz/include/cctz/civil_time_detail.h"
395  "time/internal/cctz/include/cctz/time_zone.h"
396  "time/internal/cctz/include/cctz/zone_info_source.h"
397  "time/internal/cctz/src/civil_time_detail.cc"
398  "time/internal/cctz/src/time_zone_fixed.cc"
399  "time/internal/cctz/src/time_zone_fixed.h"
400  "time/internal/cctz/src/time_zone_format.cc"
401  "time/internal/cctz/src/time_zone_if.cc"
402  "time/internal/cctz/src/time_zone_if.h"
403  "time/internal/cctz/src/time_zone_impl.cc"
404  "time/internal/cctz/src/time_zone_impl.h"
405  "time/internal/cctz/src/time_zone_info.cc"
406  "time/internal/cctz/src/time_zone_info.h"
407  "time/internal/cctz/src/time_zone_libc.cc"
408  "time/internal/cctz/src/time_zone_libc.h"
409  "time/internal/cctz/src/time_zone_lookup.cc"
410  "time/internal/cctz/src/time_zone_posix.cc"
411  "time/internal/cctz/src/time_zone_posix.h"
412  "time/internal/cctz/src/tzfile.h"
413  "time/internal/cctz/src/zone_info_source.cc"
414  "types/any.h"
415  "types/bad_any_cast.cc"
416  "types/bad_any_cast.h"
417  "types/bad_optional_access.cc"
418  "types/bad_optional_access.h"
419  "types/bad_variant_access.cc"
420  "types/bad_variant_access.h"
421  "types/compare.h"
422  "types/internal/conformance_aliases.h"
423  "types/internal/conformance_archetype.h"
424  "types/internal/conformance_profile.h"
425  "types/internal/parentheses.h"
426  "types/internal/transform_args.h"
427  "types/internal/variant.h"
428  "types/optional.h"
429  "types/internal/optional.h"
430  "types/span.h"
431  "types/internal/span.h"
432  "types/variant.h"
433  "utility/internal/if_constexpr.h"
434  "utility/utility.h"
435  "debugging/leak_check.cc"
436)
437
438set(ABSL_INTERNAL_DLL_TARGETS
439  "absl_check"
440  "absl_log"
441  "algorithm"
442  "algorithm_container"
443  "any"
444  "any_invocable"
445  "atomic_hook"
446  "bad_any_cast"
447  "bad_any_cast_impl"
448  "bad_optional_access"
449  "bad_variant_access"
450  "base"
451  "base_internal"
452  "bind_front"
453  "bits"
454  "btree"
455  "check"
456  "city"
457  "civil_time"
458  "compare"
459  "compressed_tuple"
460  "config"
461  "container"
462  "container_common"
463  "container_memory"
464  "cord"
465  "cord_internal"
466  "cordz_functions"
467  "cordz_handle"
468  "cordz_info"
469  "cordz_sample_token"
470  "core_headers"
471  "counting_allocator"
472  "crc_cord_state"
473  "crc_cpu_detect"
474  "crc_internal"
475  "crc32c"
476  "debugging"
477  "debugging_internal"
478  "demangle_internal"
479  "die_if_null"
480  "dynamic_annotations"
481  "endian"
482  "examine_stack"
483  "exponential_biased"
484  "failure_signal_handler"
485  "fixed_array"
486  "flat_hash_map"
487  "flat_hash_set"
488  "function_ref"
489  "graphcycles_internal"
490  "hash"
491  "hash_function_defaults"
492  "hash_policy_traits"
493  "hashtable_debug"
494  "hashtable_debug_hooks"
495  "hashtablez_sampler"
496  "inlined_vector"
497  "inlined_vector_internal"
498  "int128"
499  "kernel_timeout_internal"
500  "layout"
501  "leak_check"
502  "log_internal_check_impl"
503  "log_internal_check_op"
504  "log_internal_conditions"
505  "log_internal_config"
506  "log_internal_format"
507  "log_internal_globals"
508  "log_internal_log_impl"
509  "log_internal_proto"
510  "log_internal_message"
511  "log_internal_log_sink_set"
512  "log_internal_nullguard"
513  "log_internal_nullstream"
514  "log_internal_strip"
515  "log_internal_voidify"
516  "log_internal_append_truncated"
517  "log_globals"
518  "log_initialize"
519  "log"
520  "log_entry"
521  "log_sink"
522  "log_sink_registry"
523  "log_streamer"
524  "log_internal_structured"
525  "log_severity"
526  "log_structured"
527  "low_level_hash"
528  "malloc_internal"
529  "memory"
530  "meta"
531  "node_hash_map"
532  "node_hash_set"
533  "node_slot_policy"
534  "non_temporal_arm_intrinsics"
535  "non_temporal_memcpy"
536  "numeric"
537  "optional"
538  "periodic_sampler"
539  "pow10_helper"
540  "pretty_function"
541  "random_bit_gen_ref"
542  "random_distributions"
543  "random_internal_distribution_caller"
544  "random_internal_distributions"
545  "random_internal_explicit_seed_seq"
546  "random_internal_fastmath"
547  "random_internal_fast_uniform_bits"
548  "random_internal_generate_real"
549  "random_internal_iostream_state_saver"
550  "random_internal_nonsecure_base"
551  "random_internal_pcg_engine"
552  "random_internal_platform"
553  "random_internal_pool_urbg"
554  "random_internal_randen"
555  "random_internal_randen_engine"
556  "random_internal_randen_hwaes"
557  "random_internal_randen_hwaes_impl"
558  "random_internal_randen_slow"
559  "random_internal_salted_seed_seq"
560  "random_internal_seed_material"
561  "random_internal_sequence_urbg"
562  "random_internal_traits"
563  "random_internal_uniform_helper"
564  "random_internal_wide_multiply"
565  "random_random"
566  "random_seed_gen_exception"
567  "random_seed_sequences"
568  "raw_hash_map"
569  "raw_hash_set"
570  "raw_logging_internal"
571  "sample_recorder"
572  "scoped_set_env"
573  "span"
574  "spinlock_wait"
575  "spy_hash_state"
576  "stack_consumption"
577  "stacktrace"
578  "status"
579  "statusor"
580  "str_format"
581  "str_format_internal"
582  "strerror"
583  "strings"
584  "strings_internal"
585  "symbolize"
586  "synchronization"
587  "thread_pool"
588  "throw_delegate"
589  "time"
590  "time_zone"
591  "tracked"
592  "type_traits"
593  "utility"
594  "variant"
595)
596
597set(ABSL_INTERNAL_TEST_DLL_FILES
598  "hash/hash_testing.h"
599  "log/scoped_mock_log.cc"
600  "log/scoped_mock_log.h"
601  "random/internal/chi_square.cc"
602  "random/internal/chi_square.h"
603  "random/internal/distribution_test_util.cc"
604  "random/internal/distribution_test_util.h"
605  "random/internal/mock_helpers.h"
606  "random/internal/mock_overload_set.h"
607  "random/mocking_bit_gen.h"
608  "random/mock_distributions.h"
609  "strings/cordz_test_helpers.h"
610  "strings/cord_test_helpers.h"
611)
612
613set(ABSL_INTERNAL_TEST_DLL_TARGETS
614  "cord_test_helpers"
615  "cordz_test_helpers"
616  "hash_testing"
617  "random_mocking_bit_gen"
618  "random_internal_distribution_test_util"
619  "random_internal_mock_overload_set"
620  "scoped_mock_log"
621)
622
623include(CheckCXXSourceCompiles)
624
625check_cxx_source_compiles(
626  [==[
627#ifdef _MSC_VER
628#  if _MSVC_LANG < 201700L
629#    error "The compiler defaults or is configured for C++ < 17"
630#  endif
631#elif __cplusplus < 201700L
632#  error "The compiler defaults or is configured for C++ < 17"
633#endif
634int main() { return 0; }
635]==]
636  ABSL_INTERNAL_AT_LEAST_CXX17)
637
638if(ABSL_INTERNAL_AT_LEAST_CXX17)
639  set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
640else()
641  set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
642endif()
643
644function(absl_internal_dll_contains)
645  cmake_parse_arguments(ABSL_INTERNAL_DLL
646    ""
647    "OUTPUT;TARGET"
648    ""
649    ${ARGN}
650  )
651
652  STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_DLL_TARGET})
653
654  list(FIND
655    ABSL_INTERNAL_DLL_TARGETS
656    "${_target}"
657    _index)
658
659  if (${_index} GREATER -1)
660    set(${ABSL_INTERNAL_DLL_OUTPUT} 1 PARENT_SCOPE)
661  else()
662    set(${ABSL_INTERNAL_DLL_OUTPUT} 0 PARENT_SCOPE)
663  endif()
664endfunction()
665
666function(absl_internal_test_dll_contains)
667  cmake_parse_arguments(ABSL_INTERNAL_TEST_DLL
668    ""
669    "OUTPUT;TARGET"
670    ""
671    ${ARGN}
672  )
673
674  STRING(REGEX REPLACE "^absl::" "" _target ${ABSL_INTERNAL_TEST_DLL_TARGET})
675
676  list(FIND
677    ABSL_INTERNAL_TEST_DLL_TARGETS
678    "${_target}"
679    _index)
680
681  if (${_index} GREATER -1)
682    set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 1 PARENT_SCOPE)
683  else()
684    set(${ABSL_INTERNAL_TEST_DLL_OUTPUT} 0 PARENT_SCOPE)
685  endif()
686endfunction()
687
688function(absl_internal_dll_targets)
689  cmake_parse_arguments(ABSL_INTERNAL_DLL
690  ""
691  "OUTPUT"
692  "DEPS"
693  ${ARGN}
694  )
695
696  set(_deps "")
697  foreach(dep IN LISTS ABSL_INTERNAL_DLL_DEPS)
698    absl_internal_dll_contains(TARGET ${dep} OUTPUT _dll_contains)
699    absl_internal_test_dll_contains(TARGET ${dep} OUTPUT _test_dll_contains)
700    if (_dll_contains)
701      list(APPEND _deps abseil_dll)
702    elseif (_test_dll_contains)
703      list(APPEND _deps abseil_test_dll)
704    else()
705      list(APPEND _deps ${dep})
706    endif()
707  endforeach()
708
709  # Because we may have added the DLL multiple times
710  list(REMOVE_DUPLICATES _deps)
711  set(${ABSL_INTERNAL_DLL_OUTPUT} "${_deps}" PARENT_SCOPE)
712endfunction()
713
714function(absl_make_dll)
715  cmake_parse_arguments(ABSL_INTERNAL_MAKE_DLL
716  ""
717  "TEST"
718  ""
719  ${ARGN}
720  )
721
722  if (ABSL_INTERNAL_MAKE_DLL_TEST)
723    set(_dll "abseil_test_dll")
724    set(_dll_files ${ABSL_INTERNAL_TEST_DLL_FILES})
725    set(_dll_libs "abseil_dll" "GTest::gtest" "GTest::gmock")
726    set(_dll_compile_definitions "GTEST_LINKED_AS_SHARED_LIBRARY=1")
727    set(_dll_includes ${absl_gtest_src_dir}/googletest/include ${absl_gtest_src_dir}/googlemock/include)
728    set(_dll_consume "ABSL_CONSUME_TEST_DLL")
729    set(_dll_build "ABSL_BUILD_TEST_DLL")
730  else()
731    set(_dll "abseil_dll")
732    set(_dll_files ${ABSL_INTERNAL_DLL_FILES})
733    set(_dll_libs "")
734    set(_dll_compile_definitions "")
735    set(_dll_includes "")
736    set(_dll_consume "ABSL_CONSUME_DLL")
737    set(_dll_build "ABSL_BUILD_DLL")
738  endif()
739
740  add_library(
741    ${_dll}
742    SHARED
743      ${_dll_files}
744  )
745  target_link_libraries(
746    ${_dll}
747    PRIVATE
748      ${_dll_libs}
749      ${ABSL_DEFAULT_LINKOPTS}
750  )
751  set_property(TARGET ${_dll} PROPERTY LINKER_LANGUAGE "CXX")
752  target_include_directories(
753    ${_dll}
754    PUBLIC
755      "$<BUILD_INTERFACE:${ABSL_COMMON_INCLUDE_DIRS}>"
756      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
757    PRIVATE
758      ${_dll_includes}
759  )
760
761  target_compile_options(
762    ${_dll}
763    PRIVATE
764      ${ABSL_DEFAULT_COPTS}
765  )
766
767  foreach(cflag ${ABSL_CC_LIB_COPTS})
768    if(${cflag} MATCHES "^(-Wno|/wd)")
769      # These flags are needed to suppress warnings that might fire in our headers.
770      set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
771    elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
772      # Don't impose our warnings on others.
773    else()
774      set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
775    endif()
776  endforeach()
777  string(REPLACE ";" " " PC_LINKOPTS "${ABSL_CC_LIB_LINKOPTS}")
778
779  FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/${_dll}.pc" CONTENT "\
780prefix=${CMAKE_INSTALL_PREFIX}\n\
781exec_prefix=\${prefix}\n\
782libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n\
783includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n\
784\n\
785Name: ${_dll}\n\
786Description: Abseil DLL library\n\
787URL: https://abseil.io/\n\
788Version: ${absl_VERSION}\n\
789Libs: -L\${libdir} $<$<NOT:$<BOOL:${ABSL_CC_LIB_IS_INTERFACE}>>:-l${_dll}> ${PC_LINKOPTS}\n\
790Cflags: -I\${includedir}${PC_CFLAGS}\n")
791  INSTALL(FILES "${CMAKE_BINARY_DIR}/lib/pkgconfig/${_dll}.pc"
792    DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
793
794  target_compile_definitions(
795    ${_dll}
796    PUBLIC
797      ${_dll_compile_definitions}
798    PRIVATE
799      ${_dll_build}
800      NOMINMAX
801    INTERFACE
802      ${ABSL_CC_LIB_DEFINES}
803      ${_dll_consume}
804  )
805
806  if(ABSL_PROPAGATE_CXX_STD)
807    # Abseil libraries require C++14 as the current minimum standard. When
808    # compiled with C++17 (either because it is the compiler's default or
809    # explicitly requested), then Abseil requires C++17.
810    target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
811  endif()
812
813  install(TARGETS ${_dll} EXPORT ${PROJECT_NAME}Targets
814        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
815        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
816        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
817  )
818
819  add_library(absl::${_dll} ALIAS ${_dll})
820endfunction()
821