File tree Expand file tree Collapse file tree 3 files changed +18
-9
lines changed
swift_build_support/swift_build_support Expand file tree Collapse file tree 3 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ from __future__ import print_function
14
14
import argparse
15
15
import multiprocessing
16
16
import os
17
+ import platform
17
18
import shutil
18
19
import sys
19
20
import textwrap
@@ -761,6 +762,12 @@ the number of parallel build jobs to use""",
761
762
"--skip-build-benchmarks" ,
762
763
]
763
764
765
+ if platform .system () == 'Darwin' :
766
+ build_script_impl_inferred_args += [
767
+ "--toolchain-prefix" ,
768
+ swift_build_support .targets .darwin_toolchain_prefix (args .install_prefix ),
769
+ ]
770
+
764
771
if args .build_subdir is None :
765
772
# Create a name for the build directory.
766
773
args .build_subdir = args .cmake_generator .replace (" " , "_" )
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ KNOWN_SETTINGS=(
86
86
cmake-generator " Unix Makefiles" " kind of build system to generate; see output of 'cmake --help' for choices"
87
87
verbose-build " " " print the commands executed during the build"
88
88
install-prefix " " " installation prefix"
89
+ toolchain-prefix " " " the path to the .xctoolchain directory that houses the install prefix path"
89
90
install-destdir " " " the path to use as the filesystem root for the installation"
90
91
install-symroot " " " the path to install debug symbols into"
91
92
swift-install-components " " " a semicolon-separated list of Swift components to install"
@@ -714,15 +715,6 @@ function true_false() {
714
715
esac
715
716
}
716
717
717
- #
718
- # Set default values for command-line parameters.
719
- #
720
-
721
- if [[ " $( uname -s) " == " Darwin" ]] ; then
722
- TOOLCHAIN_PREFIX=$( echo ${INSTALL_PREFIX} | sed -E ' s/\/usr$//' )
723
- fi
724
-
725
-
726
718
# A list of deployment targets to cross-compile the Swift host tools for.
727
719
# We can't run the resulting binaries on the build machine.
728
720
CROSS_TOOLS_DEPLOYMENT_TARGETS=()
Original file line number Diff line number Diff line change 8
8
# See http://swift.org/LICENSE.txt for license information
9
9
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
10
11
+ import os
11
12
import platform
12
13
13
14
@@ -56,3 +57,12 @@ def install_prefix():
56
57
return '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr'
57
58
else :
58
59
return '/usr'
60
+
61
+
62
+ def darwin_toolchain_prefix (darwin_install_prefix ):
63
+ """
64
+ Given the install prefix for a Darwin system, and assuming that that path
65
+ is to a .xctoolchain directory, return the path to the .xctoolchain
66
+ directory.
67
+ """
68
+ return os .path .split (darwin_install_prefix )[0 ]
You can’t perform that action at this time.
0 commit comments