@@ -601,6 +601,8 @@ class BuildScriptInvocation(object):
601
601
"--host-target" , args .host_target ,
602
602
"--stdlib-deployment-targets" ,
603
603
" " .join (args .stdlib_deployment_targets ),
604
+ "--host-cc" , toolchain .cc ,
605
+ "--host-cxx" , toolchain .cxx ,
604
606
"--darwin-xcrun-toolchain" , args .darwin_xcrun_toolchain ,
605
607
"--darwin-deployment-version-osx=%s" % (
606
608
args .darwin_deployment_version_osx ),
@@ -611,8 +613,6 @@ class BuildScriptInvocation(object):
611
613
"--darwin-deployment-version-watchos=%s" % (
612
614
args .darwin_deployment_version_watchos ),
613
615
"--cmake" , toolchain .cmake ,
614
- "--cmake-c-compiler" , toolchain .cc ,
615
- "--cmake-cxx-compiler" , toolchain .cxx ,
616
616
"--cmark-build-type" , args .cmark_build_variant ,
617
617
"--llvm-build-type" , args .llvm_build_variant ,
618
618
"--swift-build-type" , args .swift_build_variant ,
@@ -682,14 +682,6 @@ class BuildScriptInvocation(object):
682
682
"--distcc" ,
683
683
"--distcc-pump=%s" % toolchain .distcc_pump
684
684
]
685
- if args .swiftenv_path :
686
- impl_args += [ "--swiftenv-path=%s" % args .swiftenv_path ]
687
- if args .swiftenv_recreate :
688
- impl_args += [ "--swiftenv-recreate" ]
689
- if args .swiftenv_script :
690
- impl_args += [ "--swiftenv-script=%s" % args .swiftenv_script ]
691
- if args .swiftenv_make :
692
- impl_args += [ "--swiftenv-make=%s" % args .swiftenv_make ]
693
685
if args .enable_asan :
694
686
impl_args += ["--enable-asan" ]
695
687
if args .enable_ubsan :
@@ -827,6 +819,12 @@ class BuildScriptInvocation(object):
827
819
"--toolchain-prefix" ,
828
820
swift_build_support .targets .darwin_toolchain_prefix (
829
821
args .install_prefix ),
822
+ "--host-lipo" , toolchain .lipo ,
823
+ ]
824
+
825
+ if toolchain .libtool is not None :
826
+ impl_args += [
827
+ "--host-libtool" , toolchain .libtool ,
830
828
]
831
829
832
830
# If we have extra_swift_args, combine all of them together and then
@@ -1046,47 +1044,6 @@ def clean_delay():
1046
1044
print ('\b \b \b \b now.' )
1047
1045
1048
1046
1049
- def handle_swiftenv_args (args ):
1050
- # Find clang in swiftenv if present
1051
- if args .swiftenv_path is None :
1052
- if args .swiftenv_recreate :
1053
- print (sys .argv [0 ], "error: using a swiftenv_recreate to make a swiftenv requires a destination in --swiftenv-path=" , file = sys .stderr )
1054
- sys .exit (2 ) # 2 is the same as `argparse` error exit code.
1055
-
1056
- if args .swiftenv_script is not None :
1057
- print (sys .argv [0 ], "error: using a swiftenv_script to make a swiftenv requires a destination in --swiftenv-path=" , file = sys .stderr )
1058
- sys .exit (2 ) # 2 is the same as `argparse` error exit code.
1059
-
1060
- if args .swiftenv_make is not None :
1061
- print (sys .argv [0 ], "error: using a swiftenv_make to make a swiftenv requires a destination in --swiftenv-path=" , file = sys .stderr )
1062
- sys .exit (2 ) # 2 is the same as `argparse` error exit code.
1063
-
1064
- if args .swiftenv_path is not None :
1065
- # mkdir the swiftenv_path
1066
- if not os .path .exists (args .swiftenv_path ):
1067
- os .makedirs (args .swiftenv_path )
1068
-
1069
- # Only use swiftenv_make/swiftenv_script if one is provided
1070
- # utils/swiftenv-make is default
1071
- if args .swiftenv_make is None :
1072
- args .swiftenv_make = os .path .join (
1073
- SWIFT_SOURCE_ROOT , "swift" , "utils" , "swiftenv-make" )
1074
- else :
1075
- args .swiftenv_make = os .path .abspath (args .swiftenv_make )
1076
-
1077
- # utils/swiftenv-script is default
1078
- if args .swiftenv_script is None :
1079
- args .swiftenv_script = os .path .join (
1080
- SWIFT_SOURCE_ROOT , "swift" , "utils" , "swiftenv-script" )
1081
- else :
1082
- args .swiftenv_script = os .path .abspath (args .swiftenv_script )
1083
-
1084
- print ("args.swiftenv_path" , args .swiftenv_path )
1085
- print ("args.swiftenv_recreate" , args .swiftenv_recreate )
1086
- print ("args.swiftenv_make" , args .swiftenv_make )
1087
- print ("args.swiftenv_script" , args .swiftenv_script )
1088
-
1089
-
1090
1047
# Main entry point for the preset mode.
1091
1048
def main_preset ():
1092
1049
parser = argparse .ArgumentParser (
@@ -1113,19 +1070,6 @@ def main_preset():
1113
1070
"--show-presets" ,
1114
1071
help = "list all presets and exit" ,
1115
1072
action = arguments .action .optional_bool )
1116
- parser .add_argument (
1117
- "--swiftenv-path" ,
1118
- help = "the absolute path to a directory containing replacement compiler commands" )
1119
- parser .add_argument (
1120
- "--swiftenv-recreate" ,
1121
- help = "a flag that, when present, will recreate the swiftenv" ,
1122
- action = arguments .action .optional_bool )
1123
- parser .add_argument (
1124
- "--swiftenv-script" ,
1125
- help = "the absolute path to a script that takes the place of toolchain commands, default uses utils/swiftenv-script" )
1126
- parser .add_argument (
1127
- "--swiftenv-make" ,
1128
- help = "the absolute path to a script that will set up a swiftenv, default uses utils/swiftenv-make" )
1129
1073
parser .add_argument (
1130
1074
"--distcc" ,
1131
1075
help = "use distcc" ,
@@ -1181,17 +1125,6 @@ def main_preset():
1181
1125
if args .build_jobs :
1182
1126
build_script_args += ["--jobs" , str (args .build_jobs )]
1183
1127
1184
- handle_swiftenv_args (args )
1185
-
1186
- if args .swiftenv_path is not None :
1187
- build_script_args += ["--swiftenv-path" , str (args .swiftenv_path )]
1188
- if args .swiftenv_recreate :
1189
- build_script_args += ["--swiftenv-recreate" ]
1190
- if args .swiftenv_make is not None :
1191
- build_script_args += ["--swiftenv-make" , str (args .swiftenv_make )]
1192
- if args .swiftenv_script is not None :
1193
- build_script_args += ["--swiftenv-script" , str (args .swiftenv_script )]
1194
-
1195
1128
diagnostics .note (
1196
1129
"using preset '" + args .preset + "', which expands to \n \n " +
1197
1130
shell .quote_command (build_script_args ) + "\n " )
@@ -2048,31 +1981,27 @@ iterations with -O",
2048
1981
metavar = "PATH" )
2049
1982
2050
1983
parser .add_argument (
2051
- "--cmake-c-compiler " ,
1984
+ "--host-cc " ,
2052
1985
help = "the absolute path to CC, the 'clang' compiler for the host "
2053
1986
"platform. Default is auto detected." ,
2054
1987
type = arguments .type .executable ,
2055
1988
metavar = "PATH" )
2056
1989
parser .add_argument (
2057
- "--cmake -cxx-compiler " ,
1990
+ "--host -cxx" ,
2058
1991
help = "the absolute path to CXX, the 'clang++' compiler for the host "
2059
1992
"platform. Default is auto detected." ,
2060
1993
type = arguments .type .executable ,
2061
1994
metavar = "PATH" )
2062
1995
parser .add_argument (
2063
- "--swiftenv-path" ,
2064
- help = "the absolute path to a directory containing replacement compiler commands" )
2065
- parser .add_argument (
2066
- "--swiftenv-recreate" ,
2067
- help = "a flag that, when present, will recreate the swiftenv" ,
2068
- default = "false" ,
2069
- action = arguments .action .optional_bool )
2070
- parser .add_argument (
2071
- "--swiftenv-script" ,
2072
- help = "the absolute path to a script that takes the place of toolchain commands" )
1996
+ "--host-lipo" ,
1997
+ help = "the absolute path to lipo. Default is auto detected." ,
1998
+ type = arguments .type .executable ,
1999
+ metavar = "PATH" )
2073
2000
parser .add_argument (
2074
- "--swiftenv-make" ,
2075
- help = "the absolute path to a script that will set up a swiftenv, default uses utils/swiftenv-make" )
2001
+ "--host-libtool" ,
2002
+ help = "the absolute path to libtool. Default is auto detected." ,
2003
+ type = arguments .type .executable ,
2004
+ metavar = "PATH" )
2076
2005
parser .add_argument (
2077
2006
"--distcc" ,
2078
2007
help = "use distcc in pump mode" ,
@@ -2244,22 +2173,14 @@ iterations with -O",
2244
2173
# Prepare and validate toolchain
2245
2174
toolchain = host_toolchain (xcrun_toolchain = args .darwin_xcrun_toolchain )
2246
2175
2247
- # Abstracted swiftenv_args for --preset and not
2248
- handle_swiftenv_args (args )
2249
-
2250
- # Let args.cmake_c_compiler win over swiftenv's cc/cxx
2251
- if args .cmake_c_compiler is None and args .swiftenv_path is not None :
2252
- if os .path .exists (args .swiftenv_path + "/clang" ):
2253
- args .cmake_c_compiler = args .swiftenv_path + "/clang"
2254
- if args .cmake_cxx_compiler is None and args .swiftenv_path is not None :
2255
- if os .path .exists (args .swiftenv_path + "/clang++" ):
2256
- args .cmake_cxx_compiler = args .swiftenv_path + "/clang++"
2257
-
2258
- if args .cmake_c_compiler is not None :
2259
- toolchain .cc = args .cmake_c_compiler
2260
- if args .cmake_cxx_compiler is not None :
2261
- toolchain .cxx = args .cmake_cxx_compiler
2262
-
2176
+ if args .host_cc is not None :
2177
+ toolchain .cc = args .host_cc
2178
+ if args .host_cxx is not None :
2179
+ toolchain .cxx = args .host_cxx
2180
+ if args .host_lipo is not None :
2181
+ toolchain .lipo = args .host_lipo
2182
+ if args .host_libtool is not None :
2183
+ toolchain .libtool = args .host_libtool
2263
2184
if args .cmake is not None :
2264
2185
toolchain .cmake = args .cmake
2265
2186
0 commit comments