File tree Expand file tree Collapse file tree 4 files changed +12
-0
lines changed
swift_build_support/swift_build_support Expand file tree Collapse file tree 4 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1250,6 +1250,12 @@ def create_argument_parser():
1250
1250
option ('--no-llvm-include-tests' , toggle_false ('llvm_include_tests' ),
1251
1251
help = 'do not generate testing targets for LLVM' )
1252
1252
1253
+ option ('--llvm-cmake-options' , append ,
1254
+ type = argparse .ShellSplitType (),
1255
+ help = 'CMake options used for llvm in the form of comma '
1256
+ 'separated options "-DCMAKE_VAR1=YES,-DCMAKE_VAR2=/tmp". Can '
1257
+ 'be called multiple times to add multiple such options.' )
1258
+
1253
1259
# -------------------------------------------------------------------------
1254
1260
in_group ('Build settings for Android' )
1255
1261
Original file line number Diff line number Diff line change 201
201
'lldb_build_with_xcode' : '0' ,
202
202
'llvm_assertions' : True ,
203
203
'llvm_build_variant' : 'Debug' ,
204
+ 'llvm_cmake_options' : [],
204
205
'llvm_enable_modules' : False ,
205
206
'llvm_include_tests' : True ,
206
207
'llvm_ninja_targets' : [],
@@ -758,6 +759,7 @@ class BuildScriptImplOption(_BaseOption):
758
759
AppendOption ('--test-paths' ),
759
760
AppendOption ('--llvm-ninja-targets' ),
760
761
AppendOption ('--llvm-ninja-targets-for-cross-compile-hosts' ),
762
+ AppendOption ('--llvm-cmake-options' ),
761
763
AppendOption ('--darwin-symroot-path-filters' ),
762
764
763
765
UnsupportedOption ('--build-jobs' ),
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ def extend(self, tuples_or_options):
61
61
for (variable , value ) in tuples_or_options :
62
62
self .define (variable , value )
63
63
64
+ def extend_raw (self , option_strings ):
65
+ self ._options .extend (option_strings )
66
+
64
67
@staticmethod
65
68
def true_false (value ):
66
69
if hasattr (value , 'lower' ):
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ def build(self, host_target):
202
202
(platform , arch ) = host_target .split ('-' )
203
203
204
204
llvm_cmake_options = self .host_cmake_options (host_target )[0 ]
205
+ llvm_cmake_options .extend_raw (self .args .llvm_cmake_options )
205
206
206
207
# TODO: handle cross compilation
207
208
llvm_cmake_options .define ('CMAKE_INSTALL_PREFIX:PATH' , self .args .install_prefix )
You can’t perform that action at this time.
0 commit comments