2016-11-14 10:43:12 +08:00
|
|
|
|
|
|
|
# Detect if we are building in the same configuration used to generate
|
|
|
|
# the abilist files.
|
|
|
|
if (DEFINED TARGET_TRIPLE
|
|
|
|
AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/${TARGET_TRIPLE}.abilist"
|
|
|
|
AND TARGET cxx_shared
|
2016-11-14 11:03:13 +08:00
|
|
|
AND ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi" OR
|
2017-01-03 06:27:45 +08:00
|
|
|
(APPLE AND "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "none"))
|
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)
|
|
|
|
set(ABILIST_FILE "${CMAKE_CURRENT_LIST_DIR}/${TARGET_TRIPLE}.abilist")
|
|
|
|
set(SYMDIFF_EXE "${LIBCXX_SOURCE_DIR}/utils/sym_check/sym_diff.py")
|
|
|
|
add_custom_target(check-cxx-abilist
|
2016-11-18 09:40:20 +08:00
|
|
|
${SYMDIFF_EXE} --only-stdlib-symbols ${ABILIST_FILE} $<TARGET_SONAME_FILE:cxx_shared>
|
2016-11-14 10:43:12 +08:00
|
|
|
DEPENDS cxx_shared
|
|
|
|
COMMENT "Testing ABI compatibility...")
|
|
|
|
endif()
|