Skip to content

[CMake] Use proper module triples for the names of standard library modules #31170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions cmake/modules/DarwinSDKs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ is_sdk_requested(OSX swift_build_osx)
if(swift_build_osx)
configure_sdk_darwin(
OSX "OS X" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX}"
macosx macosx macosx "${SUPPORTED_OSX_ARCHS}")
macosx macosx macosx macos "${SUPPORTED_OSX_ARCHS}")
configure_target_variant(OSX-DA "OS X Debug+Asserts" OSX DA "Debug+Asserts")
configure_target_variant(OSX-RA "OS X Release+Asserts" OSX RA "Release+Asserts")
configure_target_variant(OSX-R "OS X Release" OSX R "Release")
Expand All @@ -33,7 +33,7 @@ is_sdk_requested(IOS swift_build_ios)
if(swift_build_ios)
configure_sdk_darwin(
IOS "iOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
iphoneos ios ios "${SUPPORTED_IOS_ARCHS}")
iphoneos ios ios ios "${SUPPORTED_IOS_ARCHS}")
configure_target_variant(IOS-DA "iOS Debug+Asserts" IOS DA "Debug+Asserts")
configure_target_variant(IOS-RA "iOS Release+Asserts" IOS RA "Release+Asserts")
configure_target_variant(IOS-R "iOS Release" IOS R "Release")
Expand All @@ -43,7 +43,8 @@ is_sdk_requested(IOS_SIMULATOR swift_build_ios_simulator)
if(swift_build_ios_simulator)
configure_sdk_darwin(
IOS_SIMULATOR "iOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_IOS}"
iphonesimulator ios-simulator ios "${SUPPORTED_IOS_SIMULATOR_ARCHS}")
iphonesimulator ios-simulator ios ios-simulator
"${SUPPORTED_IOS_SIMULATOR_ARCHS}")
configure_target_variant(
IOS_SIMULATOR-DA "iOS Debug+Asserts" IOS_SIMULATOR DA "Debug+Asserts")
configure_target_variant(
Expand All @@ -56,7 +57,7 @@ is_sdk_requested(TVOS swift_build_tvos)
if(swift_build_tvos)
configure_sdk_darwin(
TVOS "tvOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
appletvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
appletvos tvos tvos tvos "${SUPPORTED_TVOS_ARCHS}")
configure_target_variant(TVOS-DA "tvOS Debug+Asserts" TVOS DA "Debug+Asserts")
configure_target_variant(TVOS-RA "tvOS Release+Asserts" TVOS RA "Release+Asserts")
configure_target_variant(TVOS-R "tvOS Release" TVOS R "Release")
Expand All @@ -66,7 +67,8 @@ is_sdk_requested(TVOS_SIMULATOR swift_build_tvos_simulator)
if(swift_build_tvos_simulator)
configure_sdk_darwin(
TVOS_SIMULATOR "tvOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_TVOS}"
appletvsimulator tvos-simulator tvos "${SUPPORTED_TVOS_SIMULATOR_ARCHS}")
appletvsimulator tvos-simulator tvos tvos-simulator
"${SUPPORTED_TVOS_SIMULATOR_ARCHS}")
configure_target_variant(
TVOS_SIMULATOR-DA "tvOS Debug+Asserts" TVOS_SIMULATOR DA "Debug+Asserts")
configure_target_variant(
Expand All @@ -79,7 +81,7 @@ is_sdk_requested(WATCHOS swift_build_watchos)
if(swift_build_watchos)
configure_sdk_darwin(
WATCHOS "watchOS" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
watchos watchos watchos watchos "${SUPPORTED_WATCHOS_ARCHS}")
configure_target_variant(WATCHOS-DA "watchOS Debug+Asserts" WATCHOS DA "Debug+Asserts")
configure_target_variant(WATCHOS-RA "watchOS Release+Asserts" WATCHOS RA "Release+Asserts")
configure_target_variant(WATCHOS-R "watchOS Release" WATCHOS R "Release")
Expand All @@ -89,7 +91,8 @@ is_sdk_requested(WATCHOS_SIMULATOR swift_build_watchos_simulator)
if(swift_build_watchos_simulator)
configure_sdk_darwin(
WATCHOS_SIMULATOR "watchOS Simulator" "${SWIFT_DARWIN_DEPLOYMENT_VERSION_WATCHOS}"
watchsimulator watchos-simulator watchos "${SUPPORTED_WATCHOS_SIMULATOR_ARCHS}")
watchsimulator watchos-simulator watchos watchos-simulator
"${SUPPORTED_WATCHOS_SIMULATOR_ARCHS}")
configure_target_variant(WATCHOS_SIMULATOR-DA "watchOS Debug+Asserts" WATCHOS_SIMULATOR DA "Debug+Asserts")
configure_target_variant(WATCHOS_SIMULATOR-RA "watchOS Release+Asserts" WATCHOS_SIMULATOR RA "Release+Asserts")
configure_target_variant(WATCHOS_SIMULATOR-R "watchOS Release" WATCHOS_SIMULATOR R "Release")
Expand Down
25 changes: 18 additions & 7 deletions cmake/modules/SwiftConfigureSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function(_report_sdk prefix)
message(STATUS " Architectures: ${SWIFT_SDK_${prefix}_ARCHITECTURES}")
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
message(STATUS " ${arch} triple: ${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}")
message(STATUS " Module triple: ${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
endforeach()
if("${prefix}" STREQUAL "WINDOWS")
foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
Expand Down Expand Up @@ -115,9 +116,10 @@ endfunction()
# SWIFT_SDK_${prefix}_ARCHITECTURES Architectures (as a list)
# SWIFT_SDK_${prefix}_IS_SIMULATOR Whether this is a simulator target.
# SWIFT_SDK_${prefix}_ARCH_${ARCH}_TRIPLE Triple name
# SWIFT_SDK_${prefix}_ARCH_${ARCH}_MODULE Module triple name for this SDK
macro(configure_sdk_darwin
prefix name deployment_version xcrun_name
version_min_name triple_name architectures)
version_min_name triple_name module_name architectures)
# Note: this has to be implemented as a macro because it sets global
# variables.

Expand Down Expand Up @@ -190,6 +192,9 @@ macro(configure_sdk_darwin
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
"${arch}-apple-${SWIFT_SDK_${prefix}_TRIPLE_NAME}")

set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE
"${arch}-apple-${module_name}")

# If this is a simulator target, append -simulator.
if (SWIFT_SDK_${prefix}_IS_SIMULATOR)
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
Expand All @@ -198,12 +203,8 @@ macro(configure_sdk_darwin

if(SWIFT_ENABLE_MACCATALYST AND "${prefix}" STREQUAL "OSX")
# For macCatalyst append the '-macabi' environment to the target triple.
set(SWIFT_SDK_MACCATALYST_ARCH_${arch}_TRIPLE
"${SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE}-macabi")

# macCatalyst triple
set(SWIFT_MACCATALYST_TRIPLE
"x86_64-apple-ios${SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST}-macabi")
set(SWIFT_SDK_MACCATALYST_ARCH_${arch}_TRIPLE "${arch}-apple-ios-macabi")
set(SWIFT_SDK_MACCATALYST_ARCH_${arch}_MODULE "${arch}-apple-ios-macabi")

# For macCatalyst, the xcrun_name is "macosx" since it uses that sdk.
# Hard code the library subdirectory to "maccatalyst" in that case.
Expand Down Expand Up @@ -256,6 +257,8 @@ macro(configure_sdk_unix name architectures)
message(SEND_ERROR "Couldn't find SWIFT_SDK_ANDROID_ARCH_armv7_PATH")
endif()
set(SWIFT_SDK_ANDROID_ARCH_${arch}_TRIPLE "armv7-none-linux-androideabi")
# The Android ABI isn't part of the module triple.
set(SWIFT_SDK_ANDROID_ARCH_${arch}_MODULE "armv7-none-linux-android")
elseif("${arch}" STREQUAL "aarch64")
set(SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE "aarch64-linux-android")
set(SWIFT_SDK_ANDROID_ARCH_${arch}_ALT_SPELLING "aarch64")
Expand Down Expand Up @@ -358,6 +361,11 @@ macro(configure_sdk_unix name architectures)
message(FATAL_ERROR "unknown Unix OS: ${prefix}")
endif()
endif()

# If the module triple wasn't set explicitly, it's the same as the triple.
if(NOT SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE)
set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")
endif()
endforeach()

# Add this to the list of known SDKs.
Expand Down Expand Up @@ -388,6 +396,9 @@ macro(configure_sdk_windows name environment architectures)
set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
"${arch}-unknown-windows-${environment}")
endif()

set(SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE "${SWIFT_SDK_${prefix}_ARCH_${arch}_MODULE}")

# NOTE: set the path to / to avoid a spurious `--sysroot` from being passed
# to the driver -- rely on the `INCLUDE` AND `LIB` environment variables
# instead.
Expand Down
19 changes: 17 additions & 2 deletions stdlib/cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,11 @@ function(_compile_swift_files
list(APPEND swift_flags "-parse-as-library")

set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
set(module_triple ${SWIFT_SDK_${SWIFTFILE_SDK}_ARCH_${SWIFTFILE_ARCHITECTURE}_MODULE})
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS OR
SWIFTFILE_SDK STREQUAL "MACCATALYST")
set(specific_module_dir "${module_base}.swiftmodule")
set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
set(module_base "${module_base}.swiftmodule/${module_triple}")
else()
set(specific_module_dir)
endif()
Expand Down Expand Up @@ -530,12 +531,20 @@ function(_compile_swift_files

set(maccatalyst_specific_module_dir
"${maccatalyst_module_dir}/${SWIFTFILE_MODULE_NAME}.swiftmodule")
set(maccatalyst_module_base "${maccatalyst_specific_module_dir}/${SWIFTFILE_ARCHITECTURE}")
set(maccatalyst_module_triple ${SWIFT_SDK_MACCATALYST_ARCH_${SWIFTFILE_ARCHITECTURE}_MODULE})
set(maccatalyst_module_base "${maccatalyst_specific_module_dir}/${maccatalyst_module_triple}")
set(maccatalyst_module_file "${maccatalyst_module_base}.swiftmodule")
set(maccatalyst_module_doc_file "${maccatalyst_module_base}.swiftdoc")

set(maccatalyst_module_outputs "${maccatalyst_module_file}" "${maccatalyst_module_doc_file}")

if(SWIFT_ENABLE_MODULE_INTERFACES)
set(maccatalyst_interface_file "${maccatalyst_module_base}.swiftinterface")
list(APPEND maccatalyst_module_outputs "${maccatalyst_interface_file}")
else()
set(maccatalyst_interface_file)
endif()

swift_install_in_component(DIRECTORY ${maccatalyst_specific_module_dir}
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${maccatalyst_library_subdir}"
COMPONENT "${SWIFTFILE_INSTALL_IN_COMPONENT}"
Expand Down Expand Up @@ -611,6 +620,12 @@ function(_compile_swift_files
list(APPEND maccatalyst_swift_flags
"-I" "${SWIFTLIB_DIR}/${maccatalyst_library_subdir}")
set(maccatalyst_swift_module_flags ${swift_module_flags})
list(FIND maccatalyst_swift_module_flags "${interface_file}" interface_file_index)
if(NOT interface_file_index EQUAL -1)
list(INSERT maccatalyst_swift_module_flags ${interface_file_index} "${maccatalyst_interface_file}")
math(EXPR old_interface_file_index "${interface_file_index} + 1")
list(REMOVE_AT maccatalyst_swift_module_flags ${old_interface_file_index})
endif()
elseif(maccatalyst_build_flavor STREQUAL "ios-like")
compute_library_subdir(maccatalyst_library_subdir
"MACCATALYST" "${SWIFTFILE_ARCHITECTURE}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// 2. Only interface is present.
// RUN: %empty-directory(%t/Lib.swiftmodule)
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.swiftmodule/%target-cpu.swiftinterface
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.swiftmodule/%module-target-triple.swiftinterface
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-parseable not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -I %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -I %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
// RUN: env SWIFT_FORCE_MODULE_LOADING=only-parseable not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -I %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
Expand All @@ -34,7 +34,7 @@
// RUN: %empty-directory(%t/MCP)

// 4. Both are present.
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.swiftmodule/%target-cpu.swiftinterface
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.swiftmodule/%module-target-triple.swiftinterface
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-parseable not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -I %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
// RUN: %empty-directory(%t/MCP)
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -I %t 2>&1 | %FileCheck -check-prefix=FROM-SERIALIZED %s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// 2. Only interface is present.
// RUN: %empty-directory(%t/Lib.framework/Modules/Lib.swiftmodule)
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.framework/Modules/Lib.swiftmodule/%target-cpu.swiftinterface
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.framework/Modules/Lib.swiftmodule/%module-target-triple.swiftinterface
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-parseable not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -F %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -F %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
// RUN: env SWIFT_FORCE_MODULE_LOADING=only-parseable not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -F %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
Expand All @@ -29,7 +29,7 @@
// RUN: not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP -F %t %s 2>&1 | %FileCheck -check-prefix=FROM-SERIALIZED %s

// 4. Both are present.
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.framework/Modules/Lib.swiftmodule/%target-cpu.swiftinterface
// RUN: cp %S/Inputs/force-module-loading-mode/Lib.swiftinterface %t/Lib.framework/Modules/Lib.swiftmodule/%module-target-triple.swiftinterface
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-parseable not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -F %t 2>&1 | %FileCheck -check-prefix=FROM-INTERFACE %s
// RUN: %empty-directory(%t/MCP)
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized not %target-swift-frontend -typecheck -parse-stdlib -module-cache-path %t/MCP %s -F %t 2>&1 | %FileCheck -check-prefix=FROM-SERIALIZED %s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Try again with architecture-specific subdirectories.
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/Lib.swiftmodule)
// RUN: %target-swift-frontend -emit-module -emit-module-interface-path %t/Lib.swiftmodule/%target-cpu.swiftinterface -emit-module-doc -parse-stdlib -o %t/Lib.swiftmodule/%target-swiftmodule-name -module-name Lib %s
// RUN: %target-swift-frontend -emit-module -emit-module-interface-path %t/Lib.swiftmodule/%module-target-triple.swiftinterface -emit-module-doc -parse-stdlib -o %t/Lib.swiftmodule/%target-swiftmodule-name -module-name Lib %s
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x -prefer-type-repr=false -fully-qualified-types=true > %t/from-module.txt
// RUN: %FileCheck %s < %t/from-module.txt

Expand Down
12 changes: 6 additions & 6 deletions test/ModuleInterface/swift_build_sdk_interfaces/iosmac.test-sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/iosmac-sdk/MacOSX.sdk/ -Fsystem-
RUN: %FileCheck %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt

CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}FMWK.framework{{\\|/}}Modules{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}/output{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks{{\\|/}}FMWK.framework{{\\|/}}Modules{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}/output{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
CHECK-DAG: MacOSX.sdk/usr/lib/swift{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}output{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/usr/lib/swift{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}output{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}FMWK.framework{{\\|/}}Modules{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-macos.swiftinterface -o {{.+}}/output{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks{{\\|/}}FMWK.framework{{\\|/}}Modules{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftinterface -o {{.+}}/output{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
CHECK-DAG: MacOSX.sdk/usr/lib/swift{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-macos.swiftinterface -o {{.+}}output{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/usr/lib/swift{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftinterface -o {{.+}}output{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule

CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule

NEGATIVE-NOT: iOSSupport{{.+}}{{macos|x86_64}}.swiftmodule
NEGATIVE-NOT: SECRET_SEARCH_PATH{{.+}}{{macos|x86_64}}.swiftmodule
6 changes: 3 additions & 3 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1791,9 +1791,9 @@ if run_vendor != 'apple':
extra_frameworks_dir = ''
config.substitutions.append(('%xcode-extra-frameworks-dir', extra_frameworks_dir))

config.substitutions.append(('%target-swiftmodule-name', run_cpu + '.swiftmodule'))
config.substitutions.append(('%target-swiftdoc-name', run_cpu + '.swiftdoc'))
config.substitutions.append(('%target-swiftsourceinfo-name', run_cpu + '.swiftsourceinfo'))
config.substitutions.append(('%target-swiftmodule-name', target_specific_module_triple + '.swiftmodule'))
config.substitutions.append(('%target-swiftdoc-name', target_specific_module_triple + '.swiftdoc'))
config.substitutions.append(('%target-swiftsourceinfo-name', target_specific_module_triple + '.swiftsourceinfo'))

config.substitutions.append(('%target-object-format', config.target_object_format))
config.substitutions.append(('%{target-shared-library-prefix}', config.target_shared_library_prefix))
Expand Down
Loading