[CMake] Fix in-tree libcxxabi build support after r283659
r283659 changed the argument to gen_link_script.py from SCRIPT_ABI_LIBNAME to LIBCXX_LIBRARIES_PUBLIC, assuming that all of the items in the LIBCXX_LIBRARIES_PUBLIC list were library names. This is not right, however, for in-tree libcxxabi builds, we might have the target name in this list. There was special logic to fixup SCRIPT_ABI_LIBNAME for this situation; change it to apply a similar fixup for LIBCXX_LIBRARIES_PUBLIC. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283684 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -244,10 +244,15 @@ endif()
|
|||||||
if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
|
if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
|
||||||
# Get the name of the ABI library and handle the case where CXXABI_LIBNAME
|
# Get the name of the ABI library and handle the case where CXXABI_LIBNAME
|
||||||
# is a target name and not a library. Ex cxxabi_shared.
|
# is a target name and not a library. Ex cxxabi_shared.
|
||||||
set(SCRIPT_ABI_LIBNAME "${LIBCXX_CXX_ABI_LIBRARY}")
|
set(LIBCXX_LIBRARIES_PUBLIC_NAMES)
|
||||||
if (SCRIPT_ABI_LIBNAME STREQUAL "cxxabi_shared")
|
foreach(lib ${LIBCXX_LIBRARIES_PUBLIC})
|
||||||
set(SCRIPT_ABI_LIBNAME "c++abi")
|
if (lib STREQUAL "cxxabi_shared")
|
||||||
endif()
|
list(APPEND LIBCXX_LIBRARIES_PUBLIC_NAMES "c++abi")
|
||||||
|
else()
|
||||||
|
list(APPEND LIBCXX_LIBRARIES_PUBLIC_NAMES "${lib}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Generate a linker script inplace of a libc++.so symlink. Rerun this command
|
# Generate a linker script inplace of a libc++.so symlink. Rerun this command
|
||||||
# after cxx builds.
|
# after cxx builds.
|
||||||
add_custom_command(TARGET cxx_shared POST_BUILD
|
add_custom_command(TARGET cxx_shared POST_BUILD
|
||||||
@@ -255,7 +260,7 @@ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
|
|||||||
${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
|
${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
|
||||||
ARGS
|
ARGS
|
||||||
"$<TARGET_LINKER_FILE:cxx_shared>"
|
"$<TARGET_LINKER_FILE:cxx_shared>"
|
||||||
"\"${LIBCXX_LIBRARIES_PUBLIC}\""
|
"\"${LIBCXX_LIBRARIES_PUBLIC_NAMES}\""
|
||||||
WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
|
WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user