@@ -60,6 +60,7 @@ pub struct Config {
60
60
generator : Option < OsString > ,
61
61
cflags : OsString ,
62
62
cxxflags : OsString ,
63
+ asmflags : OsString ,
63
64
defines : Vec < ( OsString , OsString ) > ,
64
65
deps : Vec < String > ,
65
66
target : Option < String > ,
@@ -106,6 +107,7 @@ impl Config {
106
107
generator : None ,
107
108
cflags : OsString :: new ( ) ,
108
109
cxxflags : OsString :: new ( ) ,
110
+ asmflags : OsString :: new ( ) ,
109
111
defines : Vec :: new ( ) ,
110
112
deps : Vec :: new ( ) ,
111
113
profile : None ,
@@ -146,6 +148,14 @@ impl Config {
146
148
self
147
149
}
148
150
151
+ /// Adds a custom flag to pass down to the ASM compiler, supplementing those
152
+ /// that this library already passes.
153
+ pub fn asmflag < P : AsRef < OsStr > > ( & mut self , flag : P ) -> & mut Config {
154
+ self . asmflags . push ( " " ) ;
155
+ self . asmflags . push ( flag. as_ref ( ) ) ;
156
+ self
157
+ }
158
+
149
159
/// Adds a new `-D` flag to pass to cmake during the generation step.
150
160
pub fn define < K , V > ( & mut self , k : K , v : V ) -> & mut Config
151
161
where
@@ -337,6 +347,7 @@ impl Config {
337
347
}
338
348
let c_compiler = c_cfg. get_compiler ( ) ;
339
349
let cxx_compiler = cxx_cfg. get_compiler ( ) ;
350
+ let asm_compiler = c_cfg. get_compiler ( ) ;
340
351
341
352
let dst = self
342
353
. out_dir
@@ -650,6 +661,7 @@ impl Config {
650
661
651
662
set_compiler ( "C" , & c_compiler, & self . cflags ) ;
652
663
set_compiler ( "CXX" , & cxx_compiler, & self . cxxflags ) ;
664
+ set_compiler ( "ASM" , & asm_compiler, & self . asmflags ) ;
653
665
}
654
666
655
667
if !self . defined ( "CMAKE_BUILD_TYPE" ) {
0 commit comments