Files
TheRock/compiler/amd-llvm/libcxx/lib/abi/CMakeLists.txt
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

84 lines
3.1 KiB
CMake

# This function generates a "unique" identifier based on various properties
# given as arguments. The idea is to encode all ABI-affecting properties
# in that identifier, so that we can store ABI information and associate it
# to a specific ABI configuration.
#
# Right now, this is done by using the ABI identifier as the filename containing
# the list of symbols exported by libc++ for that configuration, however we could
# make it more sophisticated if the number of ABI-affecting parameters grew.
function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx)
set(abi_properties)
if ("${triple}" MATCHES "darwin")
# Ignore the major, minor, and patchlevel versions of darwin targets.
string(REGEX REPLACE "darwin[0-9]+\\.[0-9]+\\.[0-9]+" "darwin" triple "${triple}")
elseif("${triple}" MATCHES "freebsd")
# Ignore the major and minor versions of freebsd targets.
string(REGEX REPLACE "freebsd[0-9]+\\.[0-9]+" "freebsd" triple "${triple}")
elseif("${triple}" MATCHES "aix")
# Ignore the V.R.M.F version string of aix targets.
string(REGEX REPLACE "aix[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+" "aix" triple "${triple}")
endif()
list(APPEND abi_properties "${triple}")
list(APPEND abi_properties "${abi_library}")
list(APPEND abi_properties "v${abi_version}")
if (${unstable})
list(APPEND abi_properties "unstable")
else()
list(APPEND abi_properties "stable")
endif()
if (${exceptions})
list(APPEND abi_properties "exceptions")
else()
list(APPEND abi_properties "noexceptions")
endif()
if (${new_delete_in_libcxx})
list(APPEND abi_properties "new")
else()
list(APPEND abi_properties "nonew")
endif()
list(JOIN abi_properties "." tmp)
set(${result} "${tmp}" PARENT_SCOPE)
endfunction()
if (CMAKE_CXX_COMPILER_TARGET)
set(triple "${CMAKE_CXX_COMPILER_TARGET}")
else()
set(triple "${LLVM_DEFAULT_TARGET_TRIPLE}")
endif()
cxx_abi_list_identifier(abi_list_identifier
"${triple}"
"${LIBCXX_CXX_ABI}"
"${LIBCXX_ABI_VERSION}"
"${LIBCXX_ABI_UNSTABLE}"
"${LIBCXX_ENABLE_EXCEPTIONS}"
"${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}"
)
if (TARGET cxx_shared)
set(abi_list_file "${CMAKE_CURRENT_SOURCE_DIR}/${abi_list_identifier}.abilist")
if (EXISTS "${abi_list_file}")
add_custom_target(check-cxx-abilist
"${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/sym_diff.py"
--only-stdlib-symbols
--strict "${abi_list_file}"
$<TARGET_FILE:cxx_shared>
DEPENDS cxx_shared
COMMENT "Testing libc++'s exported symbols against the ABI list")
else()
message(STATUS "ABI list file not generated for configuration ${abi_list_identifier}, `check-cxx-abilist` will not be available.")
endif()
add_custom_target(generate-cxx-abilist
COMMAND "${Python3_EXECUTABLE}" "${LIBCXX_SOURCE_DIR}/utils/generate_abi_list.py"
--output "${abi_list_file}"
"$<TARGET_FILE:cxx_shared>"
DEPENDS cxx_shared
COMMENT "Generating the ABI list file for configuration ${abi_list_identifier}")
else()
message(STATUS "Not building a shared library for libc++ -- the ABI list targets will not be available.")
endif()