@@ -202,14 +202,6 @@ add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
202
202
add_custom_target (cxx-generated-config ALL
203
203
DEPENDS ${LIBCXX_BINARY_DIR} /__generated_config )
204
204
205
- # In some build configurations (like bootstrapping clang), we need to be able to
206
- # install the libcxx headers before the CMake configuration for libcxx runs. Making
207
- # the name of this target configurable allows LLVM/runtimes/CMakeLists.txt to
208
- # add this subdirectory to the LLVM build to put libcxx's headers in place
209
- # before libcxx's build configuration is run.
210
- if (NOT CXX_HEADER_TARGET )
211
- set (CXX_HEADER_TARGET cxx-headers )
212
- endif ()
213
205
if (LIBCXX_HEADER_DIR )
214
206
set (output_dir ${LIBCXX_HEADER_DIR} /include/c++/v1 )
215
207
@@ -234,31 +226,31 @@ if(LIBCXX_HEADER_DIR)
234
226
list (APPEND out_files ${dst} )
235
227
add_custom_target (generate-cxx-headers DEPENDS ${out_files} )
236
228
237
- add_library (${CXX_HEADER_TARGET} INTERFACE )
238
- add_dependencies (${CXX_HEADER_TARGET} generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET} )
229
+ add_library (cxx-headers INTERFACE )
230
+ add_dependencies (cxx-headers generate-cxx-headers ${LIBCXX_CXX_ABI_HEADER_TARGET} )
239
231
# TODO: Use target_include_directories once we figure out why that breaks the runtimes build
240
232
if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC" )
241
- target_compile_options (${CXX_HEADER_TARGET} INTERFACE /I "${output_dir} " )
233
+ target_compile_options (cxx-headers INTERFACE /I "${output_dir} " )
242
234
else ()
243
- target_compile_options (${CXX_HEADER_TARGET} INTERFACE -I "${output_dir} " )
235
+ target_compile_options (cxx-headers INTERFACE -I "${output_dir} " )
244
236
endif ()
245
237
246
238
# Make sure the generated __config_site header is included when we build the library.
247
239
if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID} " STREQUAL "MSVC" )
248
- target_compile_options (${CXX_HEADER_TARGET} INTERFACE /FI "${LIBCXX_BINARY_DIR} /__config_site" )
240
+ target_compile_options (cxx-headers INTERFACE /FI "${LIBCXX_BINARY_DIR} /__config_site" )
249
241
else ()
250
- target_compile_options (${CXX_HEADER_TARGET} INTERFACE -include "${LIBCXX_BINARY_DIR} /__config_site" )
242
+ target_compile_options (cxx-headers INTERFACE -include "${LIBCXX_BINARY_DIR} /__config_site" )
251
243
endif ()
252
244
else ()
253
- add_library (${CXX_HEADER_TARGET} INTERFACE )
245
+ add_library (cxx-headers INTERFACE )
254
246
endif ()
255
247
256
248
if (LIBCXX_INSTALL_HEADERS )
257
249
foreach (file ${files} )
258
250
get_filename_component (dir ${file} DIRECTORY )
259
251
install (FILES ${file}
260
252
DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX} include /c++/v1/${dir}
261
- COMPONENT ${CXX_HEADER_TARGET}
253
+ COMPONENT cxx-headers
262
254
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
263
255
)
264
256
endforeach ()
@@ -268,15 +260,15 @@ if (LIBCXX_INSTALL_HEADERS)
268
260
DESTINATION ${LIBCXX_INSTALL_HEADER_PREFIX} include /c++/v1
269
261
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
270
262
RENAME __config
271
- COMPONENT ${CXX_HEADER_TARGET} )
263
+ COMPONENT cxx-headers )
272
264
273
265
if (NOT CMAKE_CONFIGURATION_TYPES )
274
- add_custom_target (install -${CXX_HEADER_TARGET}
275
- DEPENDS ${CXX_HEADER_TARGET} cxx-generated-config
266
+ add_custom_target (install -cxx-headers
267
+ DEPENDS cxx-headers cxx-generated-config
276
268
COMMAND "${CMAKE_COMMAND} "
277
- -DCMAKE_INSTALL_COMPONENT=${CXX_HEADER_TARGET}
269
+ -DCMAKE_INSTALL_COMPONENT=cxx-headers
278
270
-P "${CMAKE_BINARY_DIR} /cmake_install.cmake" )
279
271
# Stripping is a no-op for headers
280
- add_custom_target (install -${CXX_HEADER_TARGET}- stripped DEPENDS install -${CXX_HEADER_TARGET} )
272
+ add_custom_target (install -cxx-headers- stripped DEPENDS install -cxx-headers )
281
273
endif ()
282
274
endif ()
0 commit comments