Only disable linker script when LIBCXX_CXX_ABI_LIBNAME is none

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@251063 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier 2015-10-22 20:54:27 +00:00
parent 5d5b59b826
commit 1cf5a81b89
2 changed files with 15 additions and 15 deletions

View File

@ -67,6 +67,20 @@ set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++) set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS}) set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
# Setup the default options if LIBCXX_CXX_ABI is not specified.
if (NOT LIBCXX_CXX_ABI)
if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
set(LIBCXX_CXX_ABI_INTREE 1)
else ()
set(LIBCXX_CXX_ABI_LIBNAME "none")
endif ()
else ()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
endif ()
# Use a static copy of the ABI library when linking libc++. This option # Use a static copy of the ABI library when linking libc++. This option
# cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT. # cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT.
option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF) option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
@ -78,8 +92,7 @@ option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY "Statically link the ABI library" OFF)
# or is specified to be "none". # or is specified to be "none".
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF) set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY
AND LIBCXX_CXX_ABI AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"
AND NOT LIBCXX_CXX_ABI STREQUAL "none"
AND PYTHONINTERP_FOUND) AND PYTHONINTERP_FOUND)
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON) set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON)
endif() endif()

View File

@ -61,19 +61,6 @@ macro(setup_abi_lib abidefines abilib abifiles abidirs)
endmacro() endmacro()
# Setup the default options if LIBCXX_CXX_ABI is not specified.
if (NOT LIBCXX_CXX_ABI)
if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
set(LIBCXX_CXX_ABI_INTREE 1)
else ()
set(LIBCXX_CXX_ABI_LIBNAME "none")
endif ()
else ()
set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
endif ()
# Configure based on the selected ABI library. # Configure based on the selected ABI library.
if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR