xref: /aosp_15_r20/external/libcxx/include/CMakeLists.txt (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Workerset(files
2*58b9f456SAndroid Build Coastguard Worker  __bit_reference
3*58b9f456SAndroid Build Coastguard Worker  __bsd_locale_defaults.h
4*58b9f456SAndroid Build Coastguard Worker  __bsd_locale_fallbacks.h
5*58b9f456SAndroid Build Coastguard Worker  __errc
6*58b9f456SAndroid Build Coastguard Worker  __debug
7*58b9f456SAndroid Build Coastguard Worker  __functional_03
8*58b9f456SAndroid Build Coastguard Worker  __functional_base
9*58b9f456SAndroid Build Coastguard Worker  __functional_base_03
10*58b9f456SAndroid Build Coastguard Worker  __hash_table
11*58b9f456SAndroid Build Coastguard Worker  __libcpp_version
12*58b9f456SAndroid Build Coastguard Worker  __locale
13*58b9f456SAndroid Build Coastguard Worker  __mutex_base
14*58b9f456SAndroid Build Coastguard Worker  __node_handle
15*58b9f456SAndroid Build Coastguard Worker  __nullptr
16*58b9f456SAndroid Build Coastguard Worker  __split_buffer
17*58b9f456SAndroid Build Coastguard Worker  __sso_allocator
18*58b9f456SAndroid Build Coastguard Worker  __std_stream
19*58b9f456SAndroid Build Coastguard Worker  __string
20*58b9f456SAndroid Build Coastguard Worker  __threading_support
21*58b9f456SAndroid Build Coastguard Worker  __tree
22*58b9f456SAndroid Build Coastguard Worker  __tuple
23*58b9f456SAndroid Build Coastguard Worker  __undef_macros
24*58b9f456SAndroid Build Coastguard Worker  algorithm
25*58b9f456SAndroid Build Coastguard Worker  any
26*58b9f456SAndroid Build Coastguard Worker  array
27*58b9f456SAndroid Build Coastguard Worker  atomic
28*58b9f456SAndroid Build Coastguard Worker  bit
29*58b9f456SAndroid Build Coastguard Worker  bitset
30*58b9f456SAndroid Build Coastguard Worker  cassert
31*58b9f456SAndroid Build Coastguard Worker  ccomplex
32*58b9f456SAndroid Build Coastguard Worker  cctype
33*58b9f456SAndroid Build Coastguard Worker  cerrno
34*58b9f456SAndroid Build Coastguard Worker  cfenv
35*58b9f456SAndroid Build Coastguard Worker  cfloat
36*58b9f456SAndroid Build Coastguard Worker  charconv
37*58b9f456SAndroid Build Coastguard Worker  chrono
38*58b9f456SAndroid Build Coastguard Worker  cinttypes
39*58b9f456SAndroid Build Coastguard Worker  ciso646
40*58b9f456SAndroid Build Coastguard Worker  climits
41*58b9f456SAndroid Build Coastguard Worker  clocale
42*58b9f456SAndroid Build Coastguard Worker  cmath
43*58b9f456SAndroid Build Coastguard Worker  codecvt
44*58b9f456SAndroid Build Coastguard Worker  compare
45*58b9f456SAndroid Build Coastguard Worker  complex
46*58b9f456SAndroid Build Coastguard Worker  complex.h
47*58b9f456SAndroid Build Coastguard Worker  condition_variable
48*58b9f456SAndroid Build Coastguard Worker  csetjmp
49*58b9f456SAndroid Build Coastguard Worker  csignal
50*58b9f456SAndroid Build Coastguard Worker  cstdarg
51*58b9f456SAndroid Build Coastguard Worker  cstdbool
52*58b9f456SAndroid Build Coastguard Worker  cstddef
53*58b9f456SAndroid Build Coastguard Worker  cstdint
54*58b9f456SAndroid Build Coastguard Worker  cstdio
55*58b9f456SAndroid Build Coastguard Worker  cstdlib
56*58b9f456SAndroid Build Coastguard Worker  cstring
57*58b9f456SAndroid Build Coastguard Worker  ctgmath
58*58b9f456SAndroid Build Coastguard Worker  ctime
59*58b9f456SAndroid Build Coastguard Worker  ctype.h
60*58b9f456SAndroid Build Coastguard Worker  cwchar
61*58b9f456SAndroid Build Coastguard Worker  cwctype
62*58b9f456SAndroid Build Coastguard Worker  deque
63*58b9f456SAndroid Build Coastguard Worker  errno.h
64*58b9f456SAndroid Build Coastguard Worker  exception
65*58b9f456SAndroid Build Coastguard Worker  experimental/__config
66*58b9f456SAndroid Build Coastguard Worker  experimental/__memory
67*58b9f456SAndroid Build Coastguard Worker  experimental/algorithm
68*58b9f456SAndroid Build Coastguard Worker  experimental/any
69*58b9f456SAndroid Build Coastguard Worker  experimental/chrono
70*58b9f456SAndroid Build Coastguard Worker  experimental/coroutine
71*58b9f456SAndroid Build Coastguard Worker  experimental/deque
72*58b9f456SAndroid Build Coastguard Worker  experimental/filesystem
73*58b9f456SAndroid Build Coastguard Worker  experimental/forward_list
74*58b9f456SAndroid Build Coastguard Worker  experimental/functional
75*58b9f456SAndroid Build Coastguard Worker  experimental/iterator
76*58b9f456SAndroid Build Coastguard Worker  experimental/list
77*58b9f456SAndroid Build Coastguard Worker  experimental/map
78*58b9f456SAndroid Build Coastguard Worker  experimental/memory_resource
79*58b9f456SAndroid Build Coastguard Worker  experimental/numeric
80*58b9f456SAndroid Build Coastguard Worker  experimental/optional
81*58b9f456SAndroid Build Coastguard Worker  experimental/propagate_const
82*58b9f456SAndroid Build Coastguard Worker  experimental/ratio
83*58b9f456SAndroid Build Coastguard Worker  experimental/regex
84*58b9f456SAndroid Build Coastguard Worker  experimental/set
85*58b9f456SAndroid Build Coastguard Worker  experimental/simd
86*58b9f456SAndroid Build Coastguard Worker  experimental/string
87*58b9f456SAndroid Build Coastguard Worker  experimental/string_view
88*58b9f456SAndroid Build Coastguard Worker  experimental/system_error
89*58b9f456SAndroid Build Coastguard Worker  experimental/tuple
90*58b9f456SAndroid Build Coastguard Worker  experimental/type_traits
91*58b9f456SAndroid Build Coastguard Worker  experimental/unordered_map
92*58b9f456SAndroid Build Coastguard Worker  experimental/unordered_set
93*58b9f456SAndroid Build Coastguard Worker  experimental/utility
94*58b9f456SAndroid Build Coastguard Worker  experimental/vector
95*58b9f456SAndroid Build Coastguard Worker  ext/__hash
96*58b9f456SAndroid Build Coastguard Worker  ext/hash_map
97*58b9f456SAndroid Build Coastguard Worker  ext/hash_set
98*58b9f456SAndroid Build Coastguard Worker  filesystem
99*58b9f456SAndroid Build Coastguard Worker  float.h
100*58b9f456SAndroid Build Coastguard Worker  forward_list
101*58b9f456SAndroid Build Coastguard Worker  fstream
102*58b9f456SAndroid Build Coastguard Worker  functional
103*58b9f456SAndroid Build Coastguard Worker  future
104*58b9f456SAndroid Build Coastguard Worker  initializer_list
105*58b9f456SAndroid Build Coastguard Worker  inttypes.h
106*58b9f456SAndroid Build Coastguard Worker  iomanip
107*58b9f456SAndroid Build Coastguard Worker  ios
108*58b9f456SAndroid Build Coastguard Worker  iosfwd
109*58b9f456SAndroid Build Coastguard Worker  iostream
110*58b9f456SAndroid Build Coastguard Worker  istream
111*58b9f456SAndroid Build Coastguard Worker  iterator
112*58b9f456SAndroid Build Coastguard Worker  limits
113*58b9f456SAndroid Build Coastguard Worker  limits.h
114*58b9f456SAndroid Build Coastguard Worker  list
115*58b9f456SAndroid Build Coastguard Worker  locale
116*58b9f456SAndroid Build Coastguard Worker  locale.h
117*58b9f456SAndroid Build Coastguard Worker  map
118*58b9f456SAndroid Build Coastguard Worker  math.h
119*58b9f456SAndroid Build Coastguard Worker  memory
120*58b9f456SAndroid Build Coastguard Worker  module.modulemap
121*58b9f456SAndroid Build Coastguard Worker  mutex
122*58b9f456SAndroid Build Coastguard Worker  new
123*58b9f456SAndroid Build Coastguard Worker  numeric
124*58b9f456SAndroid Build Coastguard Worker  optional
125*58b9f456SAndroid Build Coastguard Worker  ostream
126*58b9f456SAndroid Build Coastguard Worker  queue
127*58b9f456SAndroid Build Coastguard Worker  random
128*58b9f456SAndroid Build Coastguard Worker  ratio
129*58b9f456SAndroid Build Coastguard Worker  regex
130*58b9f456SAndroid Build Coastguard Worker  scoped_allocator
131*58b9f456SAndroid Build Coastguard Worker  set
132*58b9f456SAndroid Build Coastguard Worker  setjmp.h
133*58b9f456SAndroid Build Coastguard Worker  shared_mutex
134*58b9f456SAndroid Build Coastguard Worker  span
135*58b9f456SAndroid Build Coastguard Worker  sstream
136*58b9f456SAndroid Build Coastguard Worker  stack
137*58b9f456SAndroid Build Coastguard Worker  stdbool.h
138*58b9f456SAndroid Build Coastguard Worker  stddef.h
139*58b9f456SAndroid Build Coastguard Worker  stdexcept
140*58b9f456SAndroid Build Coastguard Worker  stdint.h
141*58b9f456SAndroid Build Coastguard Worker  stdio.h
142*58b9f456SAndroid Build Coastguard Worker  stdlib.h
143*58b9f456SAndroid Build Coastguard Worker  streambuf
144*58b9f456SAndroid Build Coastguard Worker  string
145*58b9f456SAndroid Build Coastguard Worker  string.h
146*58b9f456SAndroid Build Coastguard Worker  string_view
147*58b9f456SAndroid Build Coastguard Worker  strstream
148*58b9f456SAndroid Build Coastguard Worker  system_error
149*58b9f456SAndroid Build Coastguard Worker  tgmath.h
150*58b9f456SAndroid Build Coastguard Worker  thread
151*58b9f456SAndroid Build Coastguard Worker  tuple
152*58b9f456SAndroid Build Coastguard Worker  type_traits
153*58b9f456SAndroid Build Coastguard Worker  typeindex
154*58b9f456SAndroid Build Coastguard Worker  typeinfo
155*58b9f456SAndroid Build Coastguard Worker  unordered_map
156*58b9f456SAndroid Build Coastguard Worker  unordered_set
157*58b9f456SAndroid Build Coastguard Worker  utility
158*58b9f456SAndroid Build Coastguard Worker  valarray
159*58b9f456SAndroid Build Coastguard Worker  variant
160*58b9f456SAndroid Build Coastguard Worker  vector
161*58b9f456SAndroid Build Coastguard Worker  version
162*58b9f456SAndroid Build Coastguard Worker  wchar.h
163*58b9f456SAndroid Build Coastguard Worker  wctype.h
164*58b9f456SAndroid Build Coastguard Worker  )
165*58b9f456SAndroid Build Coastguard Worker
166*58b9f456SAndroid Build Coastguard Workerif(LIBCXX_INSTALL_SUPPORT_HEADERS)
167*58b9f456SAndroid Build Coastguard Worker  set(files
168*58b9f456SAndroid Build Coastguard Worker    ${files}
169*58b9f456SAndroid Build Coastguard Worker    support/android/locale_bionic.h
170*58b9f456SAndroid Build Coastguard Worker    support/fuchsia/xlocale.h
171*58b9f456SAndroid Build Coastguard Worker    support/ibm/limits.h
172*58b9f456SAndroid Build Coastguard Worker    support/ibm/locale_mgmt_aix.h
173*58b9f456SAndroid Build Coastguard Worker    support/ibm/support.h
174*58b9f456SAndroid Build Coastguard Worker    support/ibm/xlocale.h
175*58b9f456SAndroid Build Coastguard Worker    support/musl/xlocale.h
176*58b9f456SAndroid Build Coastguard Worker    support/newlib/xlocale.h
177*58b9f456SAndroid Build Coastguard Worker    support/solaris/floatingpoint.h
178*58b9f456SAndroid Build Coastguard Worker    support/solaris/wchar.h
179*58b9f456SAndroid Build Coastguard Worker    support/solaris/xlocale.h
180*58b9f456SAndroid Build Coastguard Worker    support/win32/limits_msvc_win32.h
181*58b9f456SAndroid Build Coastguard Worker    support/win32/locale_win32.h
182*58b9f456SAndroid Build Coastguard Worker    support/xlocale/__nop_locale_mgmt.h
183*58b9f456SAndroid Build Coastguard Worker    support/xlocale/__posix_l_fallback.h
184*58b9f456SAndroid Build Coastguard Worker    support/xlocale/__strtonum_fallback.h
185*58b9f456SAndroid Build Coastguard Worker    support/xlocale/xlocale.h
186*58b9f456SAndroid Build Coastguard Worker    )
187*58b9f456SAndroid Build Coastguard Workerendif()
188*58b9f456SAndroid Build Coastguard Worker
189*58b9f456SAndroid Build Coastguard Workerif (LIBCXX_NEEDS_SITE_CONFIG)
190*58b9f456SAndroid Build Coastguard Worker  # Generate a custom __config header. The new header is created
191*58b9f456SAndroid Build Coastguard Worker  # by prepending __config_site to the current __config header.
192*58b9f456SAndroid Build Coastguard Worker  add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
193*58b9f456SAndroid Build Coastguard Worker    COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
194*58b9f456SAndroid Build Coastguard Worker      ${LIBCXX_BINARY_DIR}/__config_site
195*58b9f456SAndroid Build Coastguard Worker      ${LIBCXX_SOURCE_DIR}/include/__config
196*58b9f456SAndroid Build Coastguard Worker      -o ${LIBCXX_BINARY_DIR}/__generated_config
197*58b9f456SAndroid Build Coastguard Worker    DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
198*58b9f456SAndroid Build Coastguard Worker            ${LIBCXX_BINARY_DIR}/__config_site
199*58b9f456SAndroid Build Coastguard Worker  )
200*58b9f456SAndroid Build Coastguard Worker  # Add a target that executes the generation commands.
201*58b9f456SAndroid Build Coastguard Worker  add_custom_target(cxx-generated-config ALL
202*58b9f456SAndroid Build Coastguard Worker    DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
203*58b9f456SAndroid Build Coastguard Worker  set(generated_config_deps cxx-generated-config)
204*58b9f456SAndroid Build Coastguard Workerelse()
205*58b9f456SAndroid Build Coastguard Worker  set(files
206*58b9f456SAndroid Build Coastguard Worker    ${files}
207*58b9f456SAndroid Build Coastguard Worker    __config
208*58b9f456SAndroid Build Coastguard Worker    )
209*58b9f456SAndroid Build Coastguard Workerendif()
210*58b9f456SAndroid Build Coastguard Worker
211*58b9f456SAndroid Build Coastguard Workerif(NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR)
212*58b9f456SAndroid Build Coastguard Worker  set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1)
213*58b9f456SAndroid Build Coastguard Worker
214*58b9f456SAndroid Build Coastguard Worker  set(out_files)
215*58b9f456SAndroid Build Coastguard Worker  foreach(f ${files})
216*58b9f456SAndroid Build Coastguard Worker    set(src ${CMAKE_CURRENT_SOURCE_DIR}/${f})
217*58b9f456SAndroid Build Coastguard Worker    set(dst ${output_dir}/${f})
218*58b9f456SAndroid Build Coastguard Worker    add_custom_command(OUTPUT ${dst}
219*58b9f456SAndroid Build Coastguard Worker      DEPENDS ${src}
220*58b9f456SAndroid Build Coastguard Worker      COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
221*58b9f456SAndroid Build Coastguard Worker      COMMENT "Copying CXX header ${f}")
222*58b9f456SAndroid Build Coastguard Worker    list(APPEND out_files ${dst})
223*58b9f456SAndroid Build Coastguard Worker  endforeach()
224*58b9f456SAndroid Build Coastguard Worker
225*58b9f456SAndroid Build Coastguard Worker  if (LIBCXX_NEEDS_SITE_CONFIG)
226*58b9f456SAndroid Build Coastguard Worker    # Copy the generated header as __config into build directory.
227*58b9f456SAndroid Build Coastguard Worker    set(src ${LIBCXX_BINARY_DIR}/__generated_config)
228*58b9f456SAndroid Build Coastguard Worker    set(dst ${output_dir}/__config)
229*58b9f456SAndroid Build Coastguard Worker    add_custom_command(OUTPUT ${dst}
230*58b9f456SAndroid Build Coastguard Worker        DEPENDS ${src} ${generated_config_deps}
231*58b9f456SAndroid Build Coastguard Worker        COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
232*58b9f456SAndroid Build Coastguard Worker        COMMENT "Copying CXX __config")
233*58b9f456SAndroid Build Coastguard Worker    list(APPEND out_files ${dst})
234*58b9f456SAndroid Build Coastguard Worker  endif()
235*58b9f456SAndroid Build Coastguard Worker
236*58b9f456SAndroid Build Coastguard Worker  add_custom_target(cxx-headers ALL DEPENDS ${out_files} ${LIBCXX_CXX_ABI_HEADER_TARGET})
237*58b9f456SAndroid Build Coastguard Workerelse()
238*58b9f456SAndroid Build Coastguard Worker  add_custom_target(cxx-headers)
239*58b9f456SAndroid Build Coastguard Workerendif()
240*58b9f456SAndroid Build Coastguard Workerset_target_properties(cxx-headers PROPERTIES FOLDER "Misc")
241*58b9f456SAndroid Build Coastguard Worker
242*58b9f456SAndroid Build Coastguard Workerif (LIBCXX_INSTALL_HEADERS)
243*58b9f456SAndroid Build Coastguard Worker  foreach(file ${files})
244*58b9f456SAndroid Build Coastguard Worker    get_filename_component(dir ${file} DIRECTORY)
245*58b9f456SAndroid Build Coastguard Worker    install(FILES ${file}
246*58b9f456SAndroid Build Coastguard Worker      DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1/${dir}
247*58b9f456SAndroid Build Coastguard Worker      COMPONENT cxx-headers
248*58b9f456SAndroid Build Coastguard Worker      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
249*58b9f456SAndroid Build Coastguard Worker    )
250*58b9f456SAndroid Build Coastguard Worker  endforeach()
251*58b9f456SAndroid Build Coastguard Worker
252*58b9f456SAndroid Build Coastguard Worker  if (LIBCXX_NEEDS_SITE_CONFIG)
253*58b9f456SAndroid Build Coastguard Worker    # Install the generated header as __config.
254*58b9f456SAndroid Build Coastguard Worker    install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
255*58b9f456SAndroid Build Coastguard Worker      DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX}include/c++/v1
256*58b9f456SAndroid Build Coastguard Worker      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
257*58b9f456SAndroid Build Coastguard Worker      RENAME __config
258*58b9f456SAndroid Build Coastguard Worker      COMPONENT cxx-headers)
259*58b9f456SAndroid Build Coastguard Worker  endif()
260*58b9f456SAndroid Build Coastguard Worker
261*58b9f456SAndroid Build Coastguard Worker  if (NOT CMAKE_CONFIGURATION_TYPES)
262*58b9f456SAndroid Build Coastguard Worker    add_custom_target(install-cxx-headers
263*58b9f456SAndroid Build Coastguard Worker                      DEPENDS cxx-headers ${generated_config_deps}
264*58b9f456SAndroid Build Coastguard Worker                      COMMAND "${CMAKE_COMMAND}"
265*58b9f456SAndroid Build Coastguard Worker                              -DCMAKE_INSTALL_COMPONENT=cxx-headers
266*58b9f456SAndroid Build Coastguard Worker                              -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
267*58b9f456SAndroid Build Coastguard Worker    # Stripping is a no-op for headers
268*58b9f456SAndroid Build Coastguard Worker    add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers)
269*58b9f456SAndroid Build Coastguard Worker
270*58b9f456SAndroid Build Coastguard Worker    add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers)
271*58b9f456SAndroid Build Coastguard Worker    add_custom_target(install-libcxx-headers-stripped DEPENDS install-cxx-headers-stripped)
272*58b9f456SAndroid Build Coastguard Worker  endif()
273*58b9f456SAndroid Build Coastguard Workerendif()
274