head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.1
	netbsd-11-0-RC3:1.1.1.1
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	perseant-exfatfs-base-20250801:1.1.1.1
	netbsd-11:1.1.1.1.0.10
	netbsd-11-base:1.1.1.1
	netbsd-10-1-RELEASE:1.1.1.1
	perseant-exfatfs-base-20240630:1.1.1.1
	perseant-exfatfs:1.1.1.1.0.8
	perseant-exfatfs-base:1.1.1.1
	netbsd-10-0-RELEASE:1.1.1.1
	netbsd-10-0-RC6:1.1.1.1
	netbsd-10-0-RC5:1.1.1.1
	netbsd-10-0-RC4:1.1.1.1
	netbsd-10-0-RC3:1.1.1.1
	netbsd-10-0-RC2:1.1.1.1
	netbsd-10-0-RC1:1.1.1.1
	netbsd-10:1.1.1.1.0.6
	netbsd-10-base:1.1.1.1
	cjep_sun2x-base1:1.1.1.1
	cjep_sun2x:1.1.1.1.0.4
	cjep_sun2x-base:1.1.1.1
	cjep_staticlib_x:1.1.1.1.0.2
	cjep_staticlib_x-base1:1.1.1.1
	LLVM-249b40b558955afe5ac2b549edcf2d7f859c8cc9:1.1.1.1
	LLVM:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2021.05.30.01.29.20;	author joerg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	ELgSWj1pehxUV6VC;

1.1.1.1
date	2021.05.30.01.29.20;	author joerg;	state Exp;
branches
	1.1.1.1.2.1;
next	;
commitid	ELgSWj1pehxUV6VC;

1.1.1.1.2.1
date	2021.05.30.01.29.20;	author cjep;	state dead;
branches;
next	1.1.1.1.2.2;
commitid	eWz9SBW0XqKjJlVC;

1.1.1.1.2.2
date	2021.05.31.22.07.35;	author cjep;	state Exp;
branches;
next	;
commitid	eWz9SBW0XqKjJlVC;


desc
@@


1.1
log
@Initial revision
@
text
@
# 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}")
  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_in_libcxx")
  else()
    list(APPEND abi_properties "no_new_in_libcxx")
  endif()

  list(JOIN abi_properties "." tmp)
  set(${result} "${tmp}" PARENT_SCOPE)
endfunction()

cxx_abi_list_identifier(abi_list_identifier
  "${TARGET_TRIPLE}"
  "${LIBCXX_CXX_ABI_LIBNAME}"
  "${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()
@


1.1.1.1
log
@Import libc++ 249b40b558955afe5ac2b549edcf2d7f859c8cc9
@
text
@@


1.1.1.1.2.1
log
@file CMakeLists.txt was added on branch cjep_staticlib_x on 2021-05-31 22:07:35 +0000
@
text
@d1 75
@


1.1.1.1.2.2
log
@sync with head
@
text
@a0 75

# 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}")
  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_in_libcxx")
  else()
    list(APPEND abi_properties "no_new_in_libcxx")
  endif()

  list(JOIN abi_properties "." tmp)
  set(${result} "${tmp}" PARENT_SCOPE)
endfunction()

cxx_abi_list_identifier(abi_list_identifier
  "${TARGET_TRIPLE}"
  "${LIBCXX_CXX_ABI_LIBNAME}"
  "${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()
@


