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