@@ -413,8 +413,6 @@ pub struct Build {
413413    pic :  Option < bool > , 
414414    use_plt :  Option < bool > , 
415415    static_crt :  Option < bool > , 
416-     shared_flag :  Option < bool > , 
417-     static_flag :  Option < bool > , 
418416    warnings_into_errors :  bool , 
419417    warnings :  Option < bool > , 
420418    extra_warnings :  Option < bool > , 
@@ -519,8 +517,6 @@ impl Build {
519517            asm_flags :  Vec :: new ( ) , 
520518            no_default_flags :  false , 
521519            files :  Vec :: new ( ) , 
522-             shared_flag :  None , 
523-             static_flag :  None , 
524520            cpp :  false , 
525521            cpp_link_stdlib :  None , 
526522            cpp_link_stdlib_static :  false , 
@@ -781,43 +777,6 @@ impl Build {
781777        Ok ( self ) 
782778    } 
783779
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- 
821780    /// Disables the generation of default compiler flags. The default compiler 
822781/// flags may cause conflicts in some cross compiling scenarios. 
823782/// 
@@ -1032,9 +991,8 @@ impl Build {
1032991/// ```no_run 
1033992/// cc::Build::new() 
1034993///     .file("src/foo.c") 
1035- ///     .shared_flag(true) 
1036994///     .cpp_link_stdlib("stdc++") 
1037- ///     .compile("libfoo.so "); 
995+ ///     .compile("foo "); 
1038996/// ``` 
1039997pub  fn  cpp_link_stdlib < ' a ,  V :  Into < Option < & ' a  str > > > ( 
1040998        & mut  self , 
@@ -2313,12 +2271,10 @@ impl Build {
23132271                    cmd. args . push ( "-finput-charset=utf-8" . into ( ) ) ; 
23142272                } 
23152273
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 ( ) ) ; 
23222278                } 
23232279
23242280                // armv7 targets get to use armv7 instructions 
@@ -2506,13 +2462,6 @@ impl Build {
25062462            self . apple_flags ( cmd) ?; 
25072463        } 
25082464
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- 
25162465        if  self . cpp  { 
25172466            match  ( self . cpp_set_stdlib . as_ref ( ) ,  cmd. family )  { 
25182467                ( None ,  _)  => { } 
0 commit comments