-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge pull request #16 from sonodima/chore/unify-docsrs-windows-checks
unify docsrs windows checks
- Loading branch information
Showing
4 changed files
with
41 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
#[cfg(not(docsrs))] | ||
#[cfg(all(windows, not(docsrs)))] | ||
extern crate cc; | ||
|
||
#[cfg(not(docsrs))] | ||
#[cfg(all(windows, not(docsrs)))] | ||
fn main() { | ||
if std::env::var("HOST").unwrap().contains("gnu") { return; } | ||
cc::Build::new().file("src/stub.c").compile("sehstub"); | ||
// TODO: this is a hack to allow this crate to build on docs.rs. | ||
// https://github.com/sonodima/microseh/pull/11#issuecomment-2385633164 | ||
if !std::env::var("HOST").unwrap_or_default().contains("gnu") { | ||
cc::Build::new().file("src/stub.c").compile("sehstub"); | ||
} | ||
} | ||
|
||
#[cfg(docsrs)] | ||
fn main() {} | ||
#[cfg(any(not(windows), docsrs))] | ||
fn main() { | ||
println!("cargo:warning=building for a non-supported platform, exception handling will not be available"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters