AbseilDll.cmake 16 KB

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