Index: libcxx/cmake/Modules/HandleLibCXXABI.cmake =================================================================== --- libcxx/cmake/Modules/HandleLibCXXABI.cmake +++ libcxx/cmake/Modules/HandleLibCXXABI.cmake @@ -79,6 +79,11 @@ set_target_properties(${target} PROPERTIES IMPORTED_LOCATION "${file}") endfunction() +function(interface_library target name) + add_library(${target} INTERFACE IMPORTED GLOBAL) + set_target_properties(${target} PROPERTIES IMPORTED_LIBNAME "${name}") +endfunction() + # Link against a system-provided libstdc++ if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++") add_library(libcxx-abi-headers INTERFACE) @@ -86,7 +91,7 @@ "cxxabi.h;bits/c++config.h;bits/os_defines.h;bits/cpu_defines.h;bits/cxxabi_tweaks.h;bits/cxxabi_forced.h") target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBSTDCXX" "-D__GLIBCXX__") - imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" stdc++) + interface_library(libcxx-abi-shared stdc++) target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers) imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" stdc++) @@ -99,7 +104,7 @@ "cxxabi.h;bits/c++config.h;bits/os_defines.h;bits/cpu_defines.h;bits/cxxabi_tweaks.h;bits/cxxabi_forced.h") target_compile_definitions(libcxx-abi-headers INTERFACE "-D__GLIBCXX__") - imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" supc++) + interface_library(libcxx-abi-shared supc++) target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers) imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" supc++) @@ -133,7 +138,7 @@ import_private_headers(libcxx-abi-headers "${LIBCXX_CXX_ABI_INCLUDE_PATHS}" "cxxabi.h;__cxxabi_config.h") target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBCXX_BUILDING_LIBCXXABI") - imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" c++abi) + interface_library(libcxx-abi-shared c++abi) target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers) imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" c++abi) @@ -154,7 +159,7 @@ "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h") target_compile_definitions(libcxx-abi-headers INTERFACE "-DLIBCXXRT") - imported_library(libcxx-abi-shared SHARED "${LIBCXX_CXX_ABI_LIBRARY_PATH}" cxxrt) + interface_library(libcxx-abi-shared cxxrt) target_link_libraries(libcxx-abi-shared INTERFACE libcxx-abi-headers) imported_library(libcxx-abi-static STATIC "${LIBCXX_CXX_ABI_LIBRARY_PATH}" cxxrt)