From 48dd87142474aa8ccfdbcdb47eda27c979755619 Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Fri, 23 Feb 2024 13:36:33 +0000 Subject: [PATCH] [Build] Add the arch to the library subdir for non-Darwin. Non-Darwin platforms don't support fat binaries, so add the architecture to the path. rdar://123504610 --- stdlib/cmake/modules/SwiftSource.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index 2c4195ec682c5..1a6d3be7c3490 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -13,7 +13,11 @@ endfunction() # Compute the library subdirectory to use for the given sdk and # architecture, placing the result in 'result_var_name'. function(compute_library_subdir result_var_name sdk arch) - set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}" PARENT_SCOPE) + if(sdk IN_LIST SWIFT_DARWIN_PLATFORMS OR sdk STREQUAL "MACCATALYST") + set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}" PARENT_SCOPE) + else() + set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}" PARENT_SCOPE) + endif() endfunction() # Return a swiftc flag (e.g. -O or -Onone) to control optimization level based