option(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT "Enable per TU ABI insulation by default. To be used by vendors." OFF)
set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI macros to define in the site config header.")
option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
+set(LIBCXX_LIBCPPABI_VERSION "2" CACHE STRING "Version of libc++abi's ABI to re-export from libc++ when re-exporting is enabled.
+ Note that this is not related to the version of libc++'s ABI itself!")
if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
else()
set(CXXABI_LIBNAME cxxabi_shared)
endif()
- set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE)
else()
# Assume c++abi is installed in the system, rely on -lc++abi link flag.
set(CXXABI_LIBNAME "c++abi")
* Building libc++ with ``-fno-rtti`` is not supported. However
linking against it with ``-fno-rtti`` is supported.
-* On OS X v10.8 and older the CMake option ``-DLIBCXX_LIBCPPABI_VERSION=""``
- must be used during configuration.
A full list of currently open libc++ bugs can be `found here`__.
endif()
if (LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
- if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
- set(LIBCXX_LIBCPPABI_VERSION "2") # Default value
- execute_process(
- COMMAND xcrun --show-sdk-version
- OUTPUT_VARIABLE sdk_ver
- RESULT_VARIABLE res
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (res EQUAL 0)
- message(STATUS "Found SDK version ${sdk_ver}")
- string(REPLACE "10." "" sdk_ver "${sdk_ver}")
- if (sdk_ver LESS 9)
- set(LIBCXX_LIBCPPABI_VERSION "")
- else()
- set(LIBCXX_LIBCPPABI_VERSION "2")
- endif()
- endif()
- endif()
-
if ("armv7" IN_LIST CMAKE_OSX_ARCHITECTURES)
- set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp")
+ set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.v${LIBCXX_LIBCPPABI_VERSION}.exp")
else()
- set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
+ set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++abi.v${LIBCXX_LIBCPPABI_VERSION}.exp")
endif()
add_link_flags(
"-compatibility_version 1"
Building libc++ with <code>-fno-rtti</code> is not supported. However
linking against it with <code>-fno-rtti</code> is supported.
</li>
- <li>
- On OS X v10.8 and older the CMake option
- <code>-DLIBCXX_LIBCPPABI_VERSION=""</code> must be used during
- configuration.
- </li>
</ul>
</p>