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