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