@@ -413,8 +413,6 @@ pub struct Build {
413
413
pic : Option < bool > ,
414
414
use_plt : Option < bool > ,
415
415
static_crt : Option < bool > ,
416
- shared_flag : Option < bool > ,
417
- static_flag : Option < bool > ,
418
416
warnings_into_errors : bool ,
419
417
warnings : Option < bool > ,
420
418
extra_warnings : Option < bool > ,
@@ -519,8 +517,6 @@ impl Build {
519
517
asm_flags : Vec :: new ( ) ,
520
518
no_default_flags : false ,
521
519
files : Vec :: new ( ) ,
522
- shared_flag : None ,
523
- static_flag : None ,
524
520
cpp : false ,
525
521
cpp_link_stdlib : None ,
526
522
cpp_link_stdlib_static : false ,
@@ -781,43 +777,6 @@ impl Build {
781
777
Ok ( self )
782
778
}
783
779
784
- /// Set the `-shared` flag.
785
- ///
786
- /// When enabled, the compiler will produce a shared object which can
787
- /// then be linked with other objects to form an executable.
788
- ///
789
- /// # Example
790
- ///
791
- /// ```no_run
792
- /// cc::Build::new()
793
- /// .file("src/foo.c")
794
- /// .shared_flag(true)
795
- /// .compile("libfoo.so");
796
- /// ```
797
- pub fn shared_flag ( & mut self , shared_flag : bool ) -> & mut Build {
798
- self . shared_flag = Some ( shared_flag) ;
799
- self
800
- }
801
-
802
- /// Set the `-static` flag.
803
- ///
804
- /// When enabled on systems that support dynamic linking, this prevents
805
- /// linking with the shared libraries.
806
- ///
807
- /// # Example
808
- ///
809
- /// ```no_run
810
- /// cc::Build::new()
811
- /// .file("src/foo.c")
812
- /// .shared_flag(true)
813
- /// .static_flag(true)
814
- /// .compile("foo");
815
- /// ```
816
- pub fn static_flag ( & mut self , static_flag : bool ) -> & mut Build {
817
- self . static_flag = Some ( static_flag) ;
818
- self
819
- }
820
-
821
780
/// Disables the generation of default compiler flags. The default compiler
822
781
/// flags may cause conflicts in some cross compiling scenarios.
823
782
///
@@ -1032,9 +991,8 @@ impl Build {
1032
991
/// ```no_run
1033
992
/// cc::Build::new()
1034
993
/// .file("src/foo.c")
1035
- /// .shared_flag(true)
1036
994
/// .cpp_link_stdlib("stdc++")
1037
- /// .compile("libfoo.so ");
995
+ /// .compile("foo ");
1038
996
/// ```
1039
997
pub fn cpp_link_stdlib < ' a , V : Into < Option < & ' a str > > > (
1040
998
& mut self ,
@@ -2313,12 +2271,10 @@ impl Build {
2313
2271
cmd. args . push ( "-finput-charset=utf-8" . into ( ) ) ;
2314
2272
}
2315
2273
2316
- if self . static_flag . is_none ( ) {
2317
- let features = self . getenv ( "CARGO_CFG_TARGET_FEATURE" ) ;
2318
- let features = features. as_deref ( ) . unwrap_or_default ( ) ;
2319
- if features. to_string_lossy ( ) . contains ( "crt-static" ) {
2320
- cmd. args . push ( "-static" . into ( ) ) ;
2321
- }
2274
+ let features = self . getenv ( "CARGO_CFG_TARGET_FEATURE" ) ;
2275
+ let features = features. as_deref ( ) . unwrap_or_default ( ) ;
2276
+ if features. to_string_lossy ( ) . contains ( "crt-static" ) {
2277
+ cmd. args . push ( "-static" . into ( ) ) ;
2322
2278
}
2323
2279
2324
2280
// armv7 targets get to use armv7 instructions
@@ -2506,13 +2462,6 @@ impl Build {
2506
2462
self . apple_flags ( cmd) ?;
2507
2463
}
2508
2464
2509
- if self . static_flag . unwrap_or ( false ) {
2510
- cmd. args . push ( "-static" . into ( ) ) ;
2511
- }
2512
- if self . shared_flag . unwrap_or ( false ) {
2513
- cmd. args . push ( "-shared" . into ( ) ) ;
2514
- }
2515
-
2516
2465
if self . cpp {
2517
2466
match ( self . cpp_set_stdlib . as_ref ( ) , cmd. family ) {
2518
2467
( None , _) => { }
0 commit comments