2016-11-14 10:43:12 +08:00
|
|
|
|
2017-01-20 08:57:08 +08:00
|
|
|
if (DEFINED TARGET_TRIPLE)
|
2018-05-30 07:52:14 +08:00
|
|
|
# Ignore the major, minor, and patchlevel versions of the darwin
|
2017-01-20 08:57:08 +08:00
|
|
|
# target.
|
2018-05-30 07:52:14 +08:00
|
|
|
string(REGEX REPLACE "darwin([0-9]+)\\.([0-9]+)\\.([0-9]+)" "darwin"
|
2017-01-20 08:57:08 +08:00
|
|
|
GENERIC_TARGET_TRIPLE "${TARGET_TRIPLE}")
|
|
|
|
endif()
|
|
|
|
|
2016-11-14 10:43:12 +08:00
|
|
|
# Detect if we are building in the same configuration used to generate
|
|
|
|
# the abilist files.
|
2017-01-20 08:57:08 +08:00
|
|
|
if (DEFINED GENERIC_TARGET_TRIPLE
|
|
|
|
AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist"
|
2016-11-14 10:43:12 +08:00
|
|
|
AND TARGET cxx_shared
|
2016-11-14 11:03:13 +08:00
|
|
|
AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
|
2017-01-03 09:18:48 +08:00
|
|
|
(APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "default"))
|
2016-11-14 10:43:12 +08:00
|
|
|
AND NOT LIBCXX_ABI_UNSTABLE
|
|
|
|
AND LIBCXX_ABI_VERSION EQUAL "1")
|
2016-11-14 10:51:30 +08:00
|
|
|
set(LIBCXX_HAS_ABILIST_CONFIGURATION 1 CACHE INTERNAL "")
|
2016-11-14 10:43:12 +08:00
|
|
|
else()
|
|
|
|
if (NOT DEFINED LIBCXX_HAS_ABILIST_CONFIGURATION)
|
2016-11-14 11:03:13 +08:00
|
|
|
message(STATUS "libc++ configuration differs from the abilist configuration. "
|
|
|
|
"check-cxx-abilist target is not supported")
|
2016-11-14 10:43:12 +08:00
|
|
|
endif()
|
2016-11-14 10:51:30 +08:00
|
|
|
set(LIBCXX_HAS_ABILIST_CONFIGURATION 0 CACHE INTERNAL "")
|
2016-11-14 10:43:12 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
if (LIBCXX_HAS_ABILIST_CONFIGURATION)
|
2017-01-20 08:57:08 +08:00
|
|
|
set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${GENERIC_TARGET_TRIPLE}.abilist")
|
2017-02-10 06:53:14 +08:00
|
|
|
set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py")
|
2016-11-14 10:43:12 +08:00
|
|
|
add_custom_target(check-cxx-abilist
|
2017-01-18 08:05:01 +08:00
|
|
|
${SYMDIFF_EXE} --only-stdlib-symbols --strict ${ABILIST_FILE}
|
|
|
|
$<TARGET_SONAME_FILE:cxx_shared>
|
2016-11-14 10:43:12 +08:00
|
|
|
DEPENDS cxx_shared
|
|
|
|
COMMENT "Testing ABI compatibility...")
|
|
|
|
endif()
|