[PATCH] Support building libc++ using an in-tree libc++abi

Dan Albert danalbert at google.com
Thu Jul 24 17:57:29 PDT 2014


Right. That makes sense. LGTM.


On Thu, Jul 24, 2014 at 5:04 PM, Russell Harmon <eatnumber1 at google.com>
wrote:

> I had to make one addition to your suggestion, specifically that of the LIBCXX_CXX_ABI_INTREE
> variable in order to know that we have a libc++abi in tree in the portion
> where I add cxxabi as a dependency.
>
>
> On Thu, Jul 24, 2014 at 5:03 PM, <eatnumber1 at google.com> wrote:
>
>> From: Russell Harmon <eatnumber1 at google.com>
>>
>> This will detect if you are building libcxx in-tree and libcxxabi is
>> available.
>> If so, it will default to using the in-tree libcxxabi by setting
>> LIBCXX_CXX_ABI
>> to "libcxxabi", LIBCXX_LIBCXXABI_INCLUDE_PATHS to
>> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include" and will add "cxxabi" as
>> a
>> proper dependency.
>> ---
>>  CMakeLists.txt | 12 +++++++++++-
>>  1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index c20e5d1..1345eef 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -46,7 +46,13 @@ option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++
>> support headers." ON)
>>
>>  set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
>>  if (NOT DEFINED LIBCXX_CXX_ABI)
>> -  set(LIBCXX_CXX_ABI "none")
>> +  if (NOT DEFINED LIBCXX_BUILT_STANDALONE AND IS_DIRECTORY
>> "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
>> +    set(LIBCXX_CXX_ABI "libcxxabi")
>> +    set(LIBCXX_LIBCXXABI_INCLUDE_PATHS
>> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
>> +    set(LIBCXX_CXX_ABI_INTREE 1)
>> +  else ()
>> +    set(LIBCXX_CXX_ABI "none")
>> +  endif ()
>>  endif()
>>  set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
>>      "Specify C++ ABI library to use." FORCE)
>> @@ -149,6 +155,10 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
>>    setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
>>      "c++abi" "cxxabi.h" ""
>>      )
>> +
>> +  if (LIBCXX_CXX_ABI_INTREE)
>> +    add_dependencies(LIBCXX_CXX_ABI_DEPS cxxabi)
>> +  endif ()
>>  elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
>>    setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
>>      "cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
>> --
>> 2.0.0.526.g5318336
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140724/dfa1bbd5/attachment.html>


More information about the cfe-commits mailing list