mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Currently we are using the same versions we use to build compiler and standard library. This is an unnecessary coupling especially when testing the generation of backdeployed executables for macOS -- here we have interest in being able to run the tests on previous OSes, not the compiler itself. To support this, add new `--darwin-test-deployment-version-<platform>` flags to build-script, which by default take the same value as the matching `--darwin-deployment-version-<platform>` ones. Addresses rdar://156724078
38 lines
1.3 KiB
CMake
38 lines
1.3 KiB
CMake
# SwiftTestUtils.cmake
|
|
#
|
|
# Utility functions for Swift testing targets
|
|
|
|
# Get the possible build flavors for testing
|
|
function(get_swift_test_build_flavors build_flavors_out_var sdk)
|
|
set(build_flavors "default")
|
|
if(SWIFT_ENABLE_MACCATALYST AND "${sdk}" STREQUAL "OSX")
|
|
list(APPEND build_flavors "ios-like")
|
|
endif()
|
|
|
|
set(${build_flavors_out_var} ${build_flavors} PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
# Get the variant suffix for test targets and folders
|
|
function(get_swift_test_variant_suffix variant_suffix_out_var sdk arch build_flavor)
|
|
if(build_flavor STREQUAL "ios-like")
|
|
set(variant_suffix "-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-maccatalyst-${arch}")
|
|
else()
|
|
set(variant_suffix "-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
|
|
endif()
|
|
|
|
set(${variant_suffix_out_var} "${variant_suffix}" PARENT_SCOPE)
|
|
endfunction()
|
|
|
|
|
|
# Get the variant triple for test targets
|
|
function(get_swift_test_versioned_target_triple variant_triple_out_var sdk arch build_flavor)
|
|
if(build_flavor STREQUAL "ios-like")
|
|
# Use the macCatalyst target triple and compiler resources for the iOS-like build flavor.
|
|
set(variant_triple "${arch}-apple-ios13.1-macabi")
|
|
else()
|
|
get_versioned_target_triple(variant_triple ${sdk} ${arch} "${SWIFT_SDK_${sdk}_TEST_DEPLOYMENT_VERSION}")
|
|
endif()
|
|
|
|
set(${variant_triple_out_var} "${variant_triple}" PARENT_SCOPE)
|
|
endfunction()
|