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