File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1092,6 +1092,11 @@ def main_preset():
1092
1092
parser .add_argument (
1093
1093
"--build-dir" ,
1094
1094
help = "specify the directory where build artifact should be stored" )
1095
+ parser .add_argument (
1096
+ "--print-build-dir" ,
1097
+ help = "Print the build directory and exit without building" ,
1098
+ action = "store_true" ,
1099
+ default = False )
1095
1100
args = parser .parse_args ()
1096
1101
if len (args .preset_file_names ) == 0 :
1097
1102
args .preset_file_names = [
@@ -1141,6 +1146,8 @@ def main_preset():
1141
1146
build_script_args = [sys .argv [0 ]]
1142
1147
if args .dry_run :
1143
1148
build_script_args += ["--dry-run" ]
1149
+ if args .print_build_dir :
1150
+ build_script_args += ["--print-build-dir" ]
1144
1151
1145
1152
build_script_args += preset_args
1146
1153
if args .distcc :
@@ -1226,6 +1233,10 @@ def main_normal():
1226
1233
if args .show_sdks :
1227
1234
debug .print_xcodebuild_versions ()
1228
1235
1236
+ if args .print_build_dir :
1237
+ print (invocation .workspace .build_root )
1238
+ return 0
1239
+
1229
1240
# Clean build directory if requested.
1230
1241
if args .clean :
1231
1242
clean_delay ()
Original file line number Diff line number Diff line change @@ -333,6 +333,8 @@ def create_argument_parser():
333
333
metavar = 'PATH' ,
334
334
help = 'name of the directory under $SWIFT_BUILD_ROOT where the '
335
335
'build products will be placed' )
336
+ option ('--print-build-dir' , toggle_true ,
337
+ help = 'print the build directory and exit without building' )
336
338
option ('--install-prefix' , store_path ,
337
339
default = targets .install_prefix (),
338
340
help = 'The installation prefix. This is where built Swift products '
Original file line number Diff line number Diff line change 161
161
'tsan_libdispatch_test' : False ,
162
162
'long_test' : False ,
163
163
'lto_type' : None ,
164
+ 'print_build_dir' : False ,
164
165
'show_sdks' : False ,
165
166
'skip_build' : False ,
166
167
'stdlib_deployment_targets' : None ,
@@ -402,6 +403,7 @@ class IgnoreOption(_BaseOption):
402
403
SetTrueOption ('--benchmark' ),
403
404
SetTrueOption ('--clean' ),
404
405
SetTrueOption ('--dry-run' ),
406
+ SetTrueOption ('--print-build-dir' ),
405
407
SetTrueOption ('--disable-guaranteed-normal-arguments' ),
406
408
SetTrueOption ('--enable-stdlibcore-exclusivity-checking' ),
407
409
SetTrueOption ('--force-optimized-typechecker' ),
You can’t perform that action at this time.
0 commit comments