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