Skip to content

Fix module triples for “ios-like” Mac Catalyst modules #31394

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 1 commit into from
May 1, 2020
Merged
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
12 changes: 6 additions & 6 deletions stdlib/cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,14 @@ function(_compile_swift_files
)

# Determine the subdirectory where the binary should be placed.
compute_library_subdir(library_subdir
"${SWIFTFILE_SDK}" "${SWIFTFILE_ARCHITECTURE}")

set(library_subdir_sdk "${SWIFTFILE_SDK}")
if(maccatalyst_build_flavor STREQUAL "ios-like")
compute_library_subdir(library_subdir
"MACCATALYST" "${SWIFTFILE_ARCHITECTURE}")
set(library_subdir_sdk "MACCATALYST")
endif()

compute_library_subdir(library_subdir
"${library_subdir_sdk}" "${SWIFTFILE_ARCHITECTURE}")

# If we have a custom module cache path, use it.
if (SWIFT_MODULE_CACHE_PATH)
list(APPEND swift_flags "-module-cache-path" "${SWIFT_MODULE_CACHE_PATH}")
Expand Down Expand Up @@ -464,7 +464,7 @@ 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})
set(module_triple ${SWIFT_SDK_${library_subdir_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")
Expand Down