Index: libcxx/lib/abi/CMakeLists.txt =================================================================== --- libcxx/lib/abi/CMakeLists.txt +++ libcxx/lib/abi/CMakeLists.txt @@ -64,12 +64,15 @@ message(STATUS "ABI list file not generated for configuration ${abi_list_identifier}, `check-cxx-abilist` will not be available.") endif() - add_custom_target(generate-cxx-abilist - COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_abi_list.py" - --output "${abi_list_file}" - "$" - DEPENDS cxx_shared - COMMENT "Generating the ABI list file for configuration ${abi_list_identifier}") + if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR + (APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default")) + add_custom_target(generate-cxx-abilist + COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_abi_list.py" + --output "${abi_list_file}" + "$" + DEPENDS cxx_shared + COMMENT "Generating the ABI list file for configuration ${abi_list_identifier}") + endif() else() message(STATUS "Not building a shared library for libc++ -- the ABI list targets will not be available.") endif()