File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ pub struct Config {
81
81
no_build_target : bool ,
82
82
verbose_cmake : bool ,
83
83
verbose_make : bool ,
84
+ pic : Option < bool > ,
84
85
}
85
86
86
87
/// Builds the native library rooted at `path` with the default cmake options.
@@ -128,9 +129,16 @@ impl Config {
128
129
no_build_target : false ,
129
130
verbose_cmake : false ,
130
131
verbose_make : false ,
132
+ pic : None ,
131
133
}
132
134
}
133
135
136
+ /// Sets flag for PIC. Otherwise use cc::Build platform default
137
+ pub fn pic ( & mut self , explicit_flag : bool ) -> & mut Config {
138
+ self . pic = Some ( explicit_flag) ;
139
+ self
140
+ }
141
+
134
142
/// Sets the build-tool generator (`-G`) for this compilation.
135
143
pub fn generator < T : AsRef < OsStr > > ( & mut self , generator : T ) -> & mut Config {
136
144
self . generator = Some ( generator. as_ref ( ) . to_owned ( ) ) ;
@@ -351,6 +359,10 @@ impl Config {
351
359
c_cfg. static_crt ( static_crt) ;
352
360
cxx_cfg. static_crt ( static_crt) ;
353
361
}
362
+ if let Some ( explicit_flag) = self . pic {
363
+ c_cfg. pic ( explicit_flag) ;
364
+ cxx_cfg. pic ( explicit_flag) ;
365
+ }
354
366
let c_compiler = c_cfg. get_compiler ( ) ;
355
367
let cxx_compiler = cxx_cfg. get_compiler ( ) ;
356
368
let asm_compiler = c_cfg. get_compiler ( ) ;
You can’t perform that action at this time.
0 commit comments