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

Russell Harmon eatnumber1 at google.com
Thu Jul 24 16:52:48 PDT 2014


Ok, I'll send my follow ups to cfe-commits.

On Thu Jul 24 2014 at 4:45:43 PM, Nikola Smiljanic <popizdeh at gmail.com>
wrote:

> Please send patches to cfe-commits.
>
>
> On Fri, Jul 25, 2014 at 9:38 AM, Dan Albert <danalbert at google.com> wrote:
>
>> On Thu, Jul 24, 2014 at 3:13 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 | 19 ++++++++++++++++++-
>>>  1 file changed, 18 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>>> index c20e5d1..a6253fa 100644
>>> --- a/CMakeLists.txt
>>> +++ b/CMakeLists.txt
>>> @@ -28,6 +28,11 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
>>>
>>>  if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
>>>    set(LIBCXX_BUILT_STANDALONE 1)
>>> +else ()
>>> +  set(libcxxabi_intree_path "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
>>> +  if (NOT IS_DIRECTORY ${libcxxabi_intree_path})
>>> +    unset (libcxxabi_intree_path)
>>> +  endif ()
>>>  endif()
>>
>>
>>>
>>>  #===============================================================================
>>> @@ -46,7 +51,11 @@ 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 (DEFINED libcxxabi_intree_path)
>>> +    set(LIBCXX_CXX_ABI "libcxxabi")
>>> +  else ()
>>> +    set(LIBCXX_CXX_ABI "none")
>>> +  endif ()
>>
>>  endif()
>>>  set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
>>>      "Specify C++ ABI library to use." FORCE)
>>> @@ -146,9 +155,17 @@ if ("${LIBCXX_CXX_ABI}" STREQUAL "libstdc++" OR
>>>      "${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
>>>      )
>>>  elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
>>> +  if (DEFINED libcxxabi_intree_path)
>>> +    set(LIBCXX_LIBCXXABI_INCLUDE_PATHS
>>> "${libcxxabi_intree_path}/include")
>>> +  endif ()
>>> +
>>>
>>
>> I think the above three changes could be merged. The second block could
>> be replaced by something like:
>>
>> 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")
>>
>> set(LIBCXX_LIBCXXABI_INCLUDE_PATHS "${CMAKE_SOURCE_DIR}/projects/libcxxabi")
>>   else()
>>     set(LIBCXX_CXX_ABI "none")
>>   endif()
>> endif()
>>
>> Or something similar. I haven't tested it though.
>>
>>
>>>     setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
>>>      "c++abi" "cxxabi.h" ""
>>>      )
>>> +
>>> +  if (DEFINED libcxxabi_intree_path)
>>> +    add_dependencies(LIBCXX_CXX_ABI_DEPS cxxabi)
>>> +  endif ()
>>>
>>
>> Good call. I had forgotten to mention this gripe.
>>
>>
>>>  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
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140724/24c6fe88/attachment.html>


More information about the cfe-dev mailing list