Michael van der Westhuizen: The attached patch add support for building against libc++abi and libcxxrt to CMake builds of libc++.
Usage (with the appropriate CC and CXX environment variables) is: $ cmake -DLIBCXX_CXX_ABI=libcxxabi '-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=/home/michael/libcxxabi/include' ../libcxx and: $ cmake -DLIBCXX_CXX_ABI=libcxxrt '-DLIBCXX_LIBCXXRT_INCLUDE_PATHS=/home/michael/libcxxrt/src' ../libcxx git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -465,6 +465,10 @@ POLICY: For non-variadic implementations, the number of arguments is limited
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
|
||||
#if __OBJC__
|
||||
# include <Foundation/NSObject.h>
|
||||
#endif
|
||||
|
||||
#include <__functional_base>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
@@ -2020,6 +2024,26 @@ struct _LIBCPP_VISIBLE hash<long double>
|
||||
}
|
||||
};
|
||||
|
||||
#if __OBJC__
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE hash<id>
|
||||
: public unary_function<id, size_t>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_t operator()(id __v) const _NOEXCEPT {return [__v hash];}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct _LIBCPP_VISIBLE equal_to<id>
|
||||
: public binary_function<id, id, bool>
|
||||
{
|
||||
_LIBCPP_INLINE_VISIBILITY bool operator()(id __x, id __y) const
|
||||
{return __x == __y || [__x isEqual: __y];}
|
||||
};
|
||||
|
||||
#endif // __OBJC__
|
||||
|
||||
// struct hash<T*> in <memory>
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
Reference in New Issue
Block a user