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():
12501250 option ('--no-llvm-include-tests' , toggle_false ('llvm_include_tests' ),
12511251 help = 'do not generate testing targets for LLVM' )
12521252
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+
12531259 # -------------------------------------------------------------------------
12541260 in_group ('Build settings for Android' )
12551261
Original file line number Diff line number Diff line change 201201 'lldb_build_with_xcode' : '0' ,
202202 'llvm_assertions' : True ,
203203 'llvm_build_variant' : 'Debug' ,
204+ 'llvm_cmake_options' : [],
204205 'llvm_enable_modules' : False ,
205206 'llvm_include_tests' : True ,
206207 'llvm_ninja_targets' : [],
@@ -758,6 +759,7 @@ class BuildScriptImplOption(_BaseOption):
758759 AppendOption ('--test-paths' ),
759760 AppendOption ('--llvm-ninja-targets' ),
760761 AppendOption ('--llvm-ninja-targets-for-cross-compile-hosts' ),
762+ AppendOption ('--llvm-cmake-options' ),
761763 AppendOption ('--darwin-symroot-path-filters' ),
762764
763765 UnsupportedOption ('--build-jobs' ),
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ def extend(self, tuples_or_options):
6161 for (variable , value ) in tuples_or_options :
6262 self .define (variable , value )
6363
64+ def extend_raw (self , option_strings ):
65+ self ._options .extend (option_strings )
66+
6467 @staticmethod
6568 def true_false (value ):
6669 if hasattr (value , 'lower' ):
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ def build(self, host_target):
202202 (platform , arch ) = host_target .split ('-' )
203203
204204 llvm_cmake_options = self .host_cmake_options (host_target )[0 ]
205+ llvm_cmake_options .extend_raw (self .args .llvm_cmake_options )
205206
206207 # TODO: handle cross compilation
207208 llvm_cmake_options .define ('CMAKE_INSTALL_PREFIX:PATH' , self .args .install_prefix )
You can’t perform that action at this time.
0 commit comments