Skip to content

Commit b4c37a5

Browse files
author
Builder
committed
Mark static_flag and shared_flag as deprecated
They are meaningless since cc-rs only generates static libraries. Closes rust-lang#1444 Closes rust-lang#594
1 parent 1ca8b2a commit b4c37a5

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cc"
3-
version = "1.2.40"
3+
version = "1.2.41"
44
authors = ["Alex Crichton <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/cc-rs"

src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,26 +783,28 @@ impl Build {
783783

784784
/// Set the `-shared` flag.
785785
///
786-
/// When enabled, the compiler will produce a shared object which can
787-
/// then be linked with other objects to form an executable.
786+
/// This will typically be ignored by the compiler when calling [`Self::compile()`] since it only
787+
/// produces static libraries.
788788
///
789789
/// # Example
790790
///
791791
/// ```no_run
792+
/// // This will create a library named "liblibfoo.so.a"
792793
/// cc::Build::new()
793794
/// .file("src/foo.c")
794795
/// .shared_flag(true)
795796
/// .compile("libfoo.so");
796797
/// ```
798+
#[deprecated = "cc only creates static libraries, setting this does nothing"]
797799
pub fn shared_flag(&mut self, shared_flag: bool) -> &mut Build {
798800
self.shared_flag = Some(shared_flag);
799801
self
800802
}
801803

802804
/// Set the `-static` flag.
803805
///
804-
/// When enabled on systems that support dynamic linking, this prevents
805-
/// linking with the shared libraries.
806+
/// This will typically be ignored by the compiler when calling [`Self::compile()`] since it only
807+
/// produces static libraries.
806808
///
807809
/// # Example
808810
///
@@ -813,6 +815,7 @@ impl Build {
813815
/// .static_flag(true)
814816
/// .compile("foo");
815817
/// ```
818+
#[deprecated = "cc only creates static libraries, setting this does nothing"]
816819
pub fn static_flag(&mut self, static_flag: bool) -> &mut Build {
817820
self.static_flag = Some(static_flag);
818821
self

0 commit comments

Comments
 (0)