@@ -244,10 +244,6 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
244244 )
245245endif ()
246246
247- if (LIBCXX_ENABLE_SHARED)
248- list (APPEND LIBCXX_BUILD_TARGETS "cxx_shared" )
249- endif ()
250-
251247if (WIN32 AND NOT MINGW AND NOT "${CMAKE_HOST_SYSTEM_NAME} " STREQUAL "Windows" )
252248 # Since we most likely do not have a mt.exe replacement, disable the
253249 # manifest bundling. This allows a normal cmake invocation to pass which
@@ -295,17 +291,11 @@ if (LIBCXX_HERMETIC_STATIC_LIBRARY)
295291 target_compile_definitions (cxx_static PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS=)
296292endif ()
297293
298- if (LIBCXX_ENABLE_STATIC)
299- list (APPEND LIBCXX_BUILD_TARGETS "cxx_static" )
300- endif ()
301294# Attempt to merge the libc++.a archive and the ABI library archive into one.
302295if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
303296 target_link_libraries (cxx_static PRIVATE libcxx-abi-static -objects)
304297endif ()
305298
306- # Add a meta-target for both libraries.
307- add_custom_target (cxx DEPENDS ${LIBCXX_BUILD_TARGETS} )
308-
309299# Build the experimental static library
310300set (LIBCXX_EXPERIMENTAL_SOURCES
311301 experimental/keep.cpp
@@ -355,6 +345,15 @@ set_target_properties(cxx_experimental
355345cxx_add_common_build_flags(cxx_experimental)
356346target_compile_options (cxx_experimental PUBLIC -D_LIBCPP_ENABLE_EXPERIMENTAL)
357347
348+ # Add a meta-target for both libraries.
349+ add_custom_target (cxx)
350+ if (LIBCXX_ENABLE_SHARED)
351+ add_dependencies (cxx cxx_shared)
352+ endif ()
353+ if (LIBCXX_ENABLE_STATIC)
354+ add_dependencies (cxx cxx_static)
355+ endif ()
356+
358357if (LIBCXX_INSTALL_SHARED_LIBRARY)
359358 install (TARGETS cxx_shared
360359 ARCHIVE DESTINATION ${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
@@ -385,30 +384,26 @@ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
385384endif ()
386385
387386if (NOT CMAKE_CONFIGURATION_TYPES )
388- if (LIBCXX_INSTALL_LIBRARY)
389- set (lib_install_target "cxx;cxx_experimental" )
390- endif ()
391- if (LIBCXX_INSTALL_HEADERS)
392- set (header_install_target install -cxx-headers)
393- endif ()
394- if (LIBCXX_INSTALL_MODULES)
395- set (module_install_target install -cxx-modules)
396- endif ()
397- add_custom_target (install -cxx
398- DEPENDS ${lib_install_target}
399- cxx_experimental
400- ${header_install_target}
401- ${module_install_target}
402- COMMAND "${CMAKE_COMMAND} "
403- -DCMAKE_INSTALL_COMPONENT=cxx
404- -P "${LIBCXX_BINARY_DIR} /cmake_install.cmake" )
405- add_custom_target (install -cxx-stripped
406- DEPENDS ${lib_install_target}
407- cxx_experimental
408- ${header_install_target}
409- ${module_install_target}
410- COMMAND "${CMAKE_COMMAND} "
411- -DCMAKE_INSTALL_COMPONENT=cxx
412- -DCMAKE_INSTALL_DO_STRIP=1
413- -P "${LIBCXX_BINARY_DIR} /cmake_install.cmake" )
387+ add_custom_target (install -cxx
388+ COMMAND "${CMAKE_COMMAND} " --install "${CMAKE_BINARY_DIR} " --component cxx)
389+ add_custom_target (install -cxx-stripped
390+ COMMAND "${CMAKE_COMMAND} " --install "${CMAKE_BINARY_DIR} " --component cxx --strip)
391+
392+ add_dependencies (install -cxx cxx_experimental)
393+ add_dependencies (install -cxx-stripped cxx_experimental)
394+
395+ if (LIBCXX_INSTALL_LIBRARY)
396+ add_dependencies (install -cxx cxx)
397+ add_dependencies (install -cxx-stripped cxx)
398+ endif ()
399+
400+ if (LIBCXX_INSTALL_HEADERS)
401+ add_dependencies (install -cxx install -cxx-headers)
402+ add_dependencies (install -cxx-stripped install -cxx-headers-stripped)
403+ endif ()
404+
405+ if (LIBCXX_INSTALL_MODULES)
406+ add_dependencies (install -cxx install -cxx-modules)
407+ add_dependencies (install -cxx-stripped install -cxx-modules-stripped)
408+ endif ()
414409endif ()
0 commit comments