mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 23:06:34 +00:00

Update the folder titles for targets in the monorepository that have not seen taken care of for some time. These are the folders that targets are organized in Visual Studio and XCode (`set_property(TARGET <target> PROPERTY FOLDER "<title>")`) when using the respective CMake's IDE generator. * Ensure that every target is in a folder * Use a folder hierarchy with each LLVM subproject as a top-level folder * Use consistent folder names between subprojects * When using target-creating functions from AddLLVM.cmake, automatically deduce the folder. This reduces the number of `set_property`/`set_target_property`, but are still necessary when `add_custom_target`, `add_executable`, `add_library`, etc. are used. A LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root CMakeLists.txt.
81 lines
2.9 KiB
CMake
81 lines
2.9 KiB
CMake
set(ASAN_ABI_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
set(ASAN_ABI_TESTSUITES)
|
|
|
|
macro(get_bits_for_arch arch bits)
|
|
if (${arch} MATCHES "arm64|x86_64")
|
|
set(${bits} 64)
|
|
else()
|
|
message(FATAL_ERROR "Unknown target architecture: ${arch}")
|
|
endif()
|
|
endmacro()
|
|
|
|
set(ASAN_ABI_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS} asan_abi)
|
|
|
|
set(ASAN_ABI_TEST_ARCH ${ASAN_ABI_SUPPORTED_ARCH})
|
|
if(APPLE)
|
|
darwin_filter_host_archs(ASAN_ABI_SUPPORTED_ARCH ASAN_ABI_TEST_ARCH)
|
|
endif()
|
|
|
|
foreach(arch ${ASAN_ABI_TEST_ARCH})
|
|
set(ASAN_ABI_TEST_TARGET_ARCH ${arch})
|
|
set(ASAN_ABI_TEST_APPLE_PLATFORM "osx")
|
|
set(ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}")
|
|
string(TOLOWER "-${arch}-${OS_NAME}" ASAN_ABI_TEST_CONFIG_SUFFIX)
|
|
get_bits_for_arch(${arch} ASAN_ABI_TEST_BITS)
|
|
get_test_cc_for_arch(${arch} ASAN_ABI_TEST_TARGET_CC ASAN_ABI_TEST_TARGET_CFLAGS)
|
|
|
|
string(TOUPPER ${arch} ARCH_UPPER_CASE)
|
|
set(CONFIG_NAME ${ARCH_UPPER_CASE}${OS_NAME}Config)
|
|
|
|
list(APPEND ASAN_ABI_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME})
|
|
configure_lit_site_cfg(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
|
|
)
|
|
endforeach()
|
|
|
|
if(APPLE)
|
|
set(ASAN_ABI_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
|
|
set(ASAN_ABI_TEST_APPLE_PLATFORMS ${SANITIZER_COMMON_SUPPORTED_OS})
|
|
|
|
foreach(platform ${ASAN_ABI_TEST_APPLE_PLATFORMS})
|
|
if ("${platform}" STREQUAL "osx")
|
|
# Skip macOS because it's handled by the code above that builds tests for the host machine.
|
|
continue()
|
|
endif()
|
|
list_intersect(
|
|
ASAN_ABI_TEST_${platform}_ARCHS
|
|
ASAN_ABI_SUPPORTED_ARCH
|
|
DARWIN_${platform}_ARCHS
|
|
)
|
|
foreach(arch ${ASAN_ABI_TEST_${platform}_ARCHS})
|
|
get_test_cflags_for_apple_platform(
|
|
"${platform}"
|
|
"${arch}"
|
|
ASAN_ABI_TEST_TARGET_CFLAGS
|
|
)
|
|
string(TOUPPER "${arch}" ARCH_UPPER_CASE)
|
|
get_capitalized_apple_platform("${platform}" PLATFORM_CAPITALIZED)
|
|
set(CONFIG_NAME "${PLATFORM_CAPITALIZED}${ARCH_UPPER_CASE}Config")
|
|
set(ASAN_ABI_TEST_CONFIG_SUFFIX "-${arch}-${platform}")
|
|
set(ASAN_ABI_TEST_APPLE_PLATFORM "${platform}")
|
|
set(ASAN_ABI_TEST_TARGET_ARCH "${arch}")
|
|
set(ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}")
|
|
get_bits_for_arch(${arch} ASAN_ABI_TEST_BITS)
|
|
configure_lit_site_cfg(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py
|
|
)
|
|
add_lit_testsuite(check-asan-abi-${platform}-${arch} "AddressSanitizerABI ${platform} ${arch} tests"
|
|
${ASAN_ABI_TESTSUITES}
|
|
EXCLUDE_FROM_CHECK_ALL
|
|
DEPENDS ${ASAN_ABI_TEST_DEPS})
|
|
endforeach()
|
|
endforeach()
|
|
endif()
|
|
|
|
add_lit_testsuite(check-asan-abi "Running the AddressSanitizerABI tests"
|
|
${ASAN_ABI_TESTSUITES}
|
|
${exclude_from_check_all}
|
|
DEPENDS ${ASAN_ABI_TEST_DEPS})
|