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