From 2612e9f3e8ee652941e2057e16f0f30e2ab8fd82 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 6 Jul 2020 23:27:34 +0900 Subject: [PATCH] [WASM] Resolve build failure by fixing cross compile issue on build-script The added lines by Apple Silicon patch really depend on the build machine platform and it forces that we can build stdlib only for darwin targets. So I changed to allow non-darwin targets and filter only unsupported darwin targets. This patch shuold be sent to upstream. --- utils/build-script | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/utils/build-script b/utils/build-script index c0493460bc626..043b0df37bc0e 100755 --- a/utils/build-script +++ b/utils/build-script @@ -354,16 +354,15 @@ def apply_default_arguments(toolchain, args): # Filter out any macOS stdlib deployment targets that are not supported # by the macOS SDK. - if platform.system() == "Darwin": - targets = StdlibDeploymentTarget.get_targets_by_name( - args.stdlib_deployment_targets) - args.stdlib_deployment_targets = [ - target.name - for target in targets - if (target.platform.is_darwin and - target.platform.sdk_supports_architecture( - target.arch, args.darwin_xcrun_toolchain)) - ] + targets = StdlibDeploymentTarget.get_targets_by_name( + args.stdlib_deployment_targets) + args.stdlib_deployment_targets = [ + target.name + for target in targets + if (not target.platform.is_darwin or + target.platform.sdk_supports_architecture( + target.arch, args.darwin_xcrun_toolchain)) + ] # Include the Darwin module-only architectures in the CMake options. if args.swift_darwin_module_archs: