[PATCH] Fix re-building in-tree libc++ against in-tree libc++abi
Viktor Kutuzov
vkutuzov at accesssoftek.com
Wed Aug 6 02:18:45 PDT 2014
Added support for custom library names specified with LIBCXX_CXX_ABI.
http://reviews.llvm.org/D4805
Files:
CMakeLists.txt
test/lit.site.cfg.in
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -46,14 +46,17 @@
set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
if (NOT DEFINED LIBCXX_CXX_ABI)
- if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
- set(LIBCXX_CXX_ABI "libcxxabi")
+ if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND
+ IS_DIRECTORY "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
+ set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_LIBCXXABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
set(LIBCXX_CXX_ABI_INTREE 1)
else ()
- set(LIBCXX_CXX_ABI "none")
+ set(LIBCXX_CXX_ABI_LIBNAME "none")
endif ()
-endif()
+else ()
+ set(LIBCXX_CXX_ABI_LIBNAME ${LIBCXX_CXX_ABI})
+endif ()
set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
"Specify C++ ABI library to use." FORCE)
set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS})
@@ -134,13 +137,13 @@
)
endmacro()
-if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++" OR
- "${LIBCXX_CXX_ABI}" STREQUAL "libsupc++")
+if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
+ "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libsupc++")
set(_LIBSUPCXX_INCLUDE_FILES
cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h
bits/cxxabi_tweaks.h bits/cxxabi_forced.h
)
- if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++")
+ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++")
set(_LIBSUPCXX_DEFINES "-DLIBSTDCXX")
set(_LIBSUPCXX_LIBNAME stdc++)
else()
@@ -151,7 +154,7 @@
"-D__GLIBCXX__ ${_LIBSUPCXX_DEFINES}"
"${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
)
-elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi")
if (LIBCXX_CXX_ABI_INTREE)
# Link against just-built "cxxabi" target.
set(CXXABI_LIBNAME cxxabi)
@@ -162,11 +165,11 @@
setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
${CXXABI_LIBNAME} "cxxabi.h" ""
)
-elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
+elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxrt")
setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
"cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
)
-elseif (NOT "${LIBCXX_CXX_ABI}" STREQUAL "none")
+elseif (NOT "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none")
message(FATAL_ERROR
"Currently libstdc++, libsupc++, libcxxabi, libcxxrt and none are "
"supported for c++ abi."
Index: test/lit.site.cfg.in
===================================================================
--- test/lit.site.cfg.in
+++ test/lit.site.cfg.in
@@ -5,7 +5,7 @@
config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.enable_shared = @LIBCXX_ENABLE_SHARED@
-config.cxx_abi = "@LIBCXX_CXX_ABI@"
+config.cxx_abi = "@LIBCXX_CXX_ABI_LIBNAME@"
# Let the main config do the real work.
lit_config.load_config(config, "@LIBCXX_SOURCE_DIR@/test/lit.cfg")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4805.12227.patch
Type: text/x-patch
Size: 3092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140806/fce10fb6/attachment.bin>
More information about the llvm-commits
mailing list