xref: /netbsd-src/external/apache2/llvm/dist/libcxx/include/CMakeLists.txt (revision 2718af68c3efc72c9769069b5c7f9ed36f6b9def)
1set(files
2  __availability
3  __bit_reference
4  __bits
5  __bsd_locale_defaults.h
6  __bsd_locale_fallbacks.h
7  __config
8  __debug
9  __errc
10  __functional_03
11  __functional_base
12  __functional_base_03
13  __hash_table
14  __iterator/concepts.h
15  __iterator/incrementable_traits.h
16  __iterator/iter_move.h
17  __iterator/iterator_traits.h
18  __iterator/readable_traits.h
19  __libcpp_version
20  __locale
21  __memory/addressof.h
22  __memory/allocation_guard.h
23  __memory/allocator.h
24  __memory/allocator_traits.h
25  __memory/auto_ptr.h
26  __memory/compressed_pair.h
27  __memory/construct_at.h
28  __memory/pointer_safety.h
29  __memory/pointer_traits.h
30  __memory/raw_storage_iterator.h
31  __memory/shared_ptr.h
32  __memory/temporary_buffer.h
33  __memory/uninitialized_algorithms.h
34  __memory/unique_ptr.h
35  __mutex_base
36  __node_handle
37  __nullptr
38  __ranges/access.h
39  __ranges/concepts.h
40  __ranges/data.h
41  __ranges/empty.h
42  __ranges/enable_borrowed_range.h
43  __ranges/view.h
44  __ranges/size.h
45  __split_buffer
46  __std_stream
47  __string
48  __threading_support
49  __tree
50  __tuple
51  __undef_macros
52  __utility/to_underlying.h
53  algorithm
54  any
55  array
56  atomic
57  barrier
58  bit
59  bitset
60  cassert
61  ccomplex
62  cctype
63  cerrno
64  cfenv
65  cfloat
66  charconv
67  chrono
68  cinttypes
69  ciso646
70  climits
71  clocale
72  cmath
73  codecvt
74  compare
75  complex
76  complex.h
77  concepts
78  condition_variable
79  csetjmp
80  csignal
81  cstdarg
82  cstdbool
83  cstddef
84  cstdint
85  cstdio
86  cstdlib
87  cstring
88  ctgmath
89  ctime
90  ctype.h
91  cwchar
92  cwctype
93  deque
94  errno.h
95  exception
96  execution
97  experimental/__config
98  experimental/__memory
99  experimental/algorithm
100  experimental/coroutine
101  experimental/deque
102  experimental/filesystem
103  experimental/forward_list
104  experimental/functional
105  experimental/iterator
106  experimental/list
107  experimental/map
108  experimental/memory_resource
109  experimental/propagate_const
110  experimental/regex
111  experimental/set
112  experimental/simd
113  experimental/string
114  experimental/type_traits
115  experimental/unordered_map
116  experimental/unordered_set
117  experimental/utility
118  experimental/vector
119  ext/__hash
120  ext/hash_map
121  ext/hash_set
122  fenv.h
123  filesystem
124  float.h
125  format
126  forward_list
127  fstream
128  functional
129  future
130  initializer_list
131  inttypes.h
132  iomanip
133  ios
134  iosfwd
135  iostream
136  istream
137  iterator
138  latch
139  limits
140  limits.h
141  list
142  locale
143  locale.h
144  map
145  math.h
146  memory
147  module.modulemap
148  mutex
149  new
150  numbers
151  numeric
152  optional
153  ostream
154  queue
155  random
156  ranges
157  ratio
158  ranges
159  regex
160  scoped_allocator
161  semaphore
162  set
163  setjmp.h
164  shared_mutex
165  span
166  sstream
167  stack
168  stdbool.h
169  stddef.h
170  stdexcept
171  stdint.h
172  stdio.h
173  stdlib.h
174  streambuf
175  string
176  string.h
177  string_view
178  strstream
179  __support/android/locale_bionic.h
180  __support/fuchsia/xlocale.h
181  __support/ibm/gettod_zos.h
182  __support/ibm/limits.h
183  __support/ibm/locale_mgmt_aix.h
184  __support/ibm/locale_mgmt_zos.h
185  __support/ibm/nanosleep.h
186  __support/ibm/support.h
187  __support/ibm/xlocale.h
188  __support/musl/xlocale.h
189  __support/newlib/xlocale.h
190  __support/nuttx/xlocale.h
191  __support/openbsd/xlocale.h
192  __support/solaris/floatingpoint.h
193  __support/solaris/wchar.h
194  __support/solaris/xlocale.h
195  __support/win32/limits_msvc_win32.h
196  __support/win32/locale_win32.h
197  __support/xlocale/__nop_locale_mgmt.h
198  __support/xlocale/__posix_l_fallback.h
199  __support/xlocale/__strtonum_fallback.h
200  system_error
201  tgmath.h
202  thread
203  tuple
204  type_traits
205  typeindex
206  typeinfo
207  unordered_map
208  unordered_set
209  utility
210  valarray
211  variant
212  vector
213  version
214  wchar.h
215  wctype.h
216  )
217
218configure_file("__config_site.in" "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site" @ONLY)
219
220set(_all_includes "${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site")
221foreach(f ${files})
222  set(src "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
223  set(dst "${LIBCXX_GENERATED_INCLUDE_DIR}/${f}")
224  add_custom_command(OUTPUT ${dst}
225    DEPENDS ${src}
226    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
227    COMMENT "Copying CXX header ${f}")
228  list(APPEND _all_includes "${dst}")
229endforeach()
230
231add_custom_target(generate-cxx-headers ALL DEPENDS ${_all_includes})
232
233add_library(cxx-headers INTERFACE)
234add_dependencies(cxx-headers generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET})
235# TODO: Use target_include_directories once we figure out why that breaks the runtimes build
236if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
237  target_compile_options(cxx-headers INTERFACE /I${LIBCXX_GENERATED_INCLUDE_DIR}
238                                     INTERFACE /I${LIBCXX_GENERATED_INCLUDE_TARGET_DIR})
239else()
240  target_compile_options(cxx-headers INTERFACE -I${LIBCXX_GENERATED_INCLUDE_DIR}
241                                     INTERFACE -I${LIBCXX_GENERATED_INCLUDE_TARGET_DIR})
242endif()
243
244if (LIBCXX_INSTALL_HEADERS)
245  foreach(file ${files})
246    get_filename_component(dir ${file} DIRECTORY)
247    install(FILES ${file}
248      DESTINATION ${LIBCXX_INSTALL_INCLUDE_DIR}/${dir}
249      COMPONENT cxx-headers
250      PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
251    )
252  endforeach()
253
254  # Install the generated __config_site.
255  install(FILES ${LIBCXX_GENERATED_INCLUDE_TARGET_DIR}/__config_site
256    DESTINATION ${LIBCXX_INSTALL_INCLUDE_TARGET_DIR}
257    PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
258    COMPONENT cxx-headers)
259
260  if (NOT CMAKE_CONFIGURATION_TYPES)
261    add_custom_target(install-cxx-headers
262                      DEPENDS cxx-headers
263                      COMMAND "${CMAKE_COMMAND}"
264                              -DCMAKE_INSTALL_COMPONENT=cxx-headers
265                              -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
266    # Stripping is a no-op for headers
267    add_custom_target(install-cxx-headers-stripped DEPENDS install-cxx-headers)
268  endif()
269endif()
270