Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross compilation from Linux to Windows #125

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ version. Much of typenum should work on as low a version as 1.20.0, but that is

### Unreleased

### 1.11.2 (2019-08-26)
- [fixed] Cross compilation from Linux to Windows.

### 1.11.1 (2019-08-25)
- [fixed] Builds on earlier Rust builds again and added Rust 1.22.0 to Travis to prevent future breakage.

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "typenum"
build = "build/main.rs"
version = "1.11.1"
version = "1.11.2"
authors = [
"Paho Lurie-Gregg <paho@paholg.com>",
"Andre Bogus <bogusandre@gmail.com>"
Expand Down
1 change: 1 addition & 0 deletions build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fn main() {

let out_dir = env::var("OUT_DIR").unwrap();
let dest = Path::new(&out_dir).join("consts.rs");
println!("cargo:rustc-env=TYPENUM_BUILD_OP={}", dest.display());

let mut f = File::create(&dest).unwrap();

Expand Down
1 change: 1 addition & 0 deletions build/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct Op {
pub fn write_op_macro() -> ::std::io::Result<()> {
let out_dir = ::std::env::var("OUT_DIR").unwrap();
let dest = ::std::path::Path::new(&out_dir).join("op.rs");
println!("cargo:rustc-env=TYPENUM_BUILD_CONSTS={}", dest.display());
let mut f = ::std::fs::File::create(&dest).unwrap();

// Operator precedence is taken from
Expand Down
11 changes: 3 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,9 @@
// trace_macros!(true);

use core::cmp::Ordering;
#[cfg(not(target_os = "windows"))]
include!(concat!(env!("OUT_DIR"), "/consts.rs"));
#[cfg(not(target_os = "windows"))]
include!(concat!(env!("OUT_DIR"), "/op.rs"));
#[cfg(target_os = "windows")]
include!(concat!(env!("OUT_DIR"), "\\consts.rs"));
#[cfg(target_os = "windows")]
include!(concat!(env!("OUT_DIR"), "\\op.rs"));

include!(env!("TYPENUM_BUILD_OP"));
include!(env!("TYPENUM_BUILD_CONSTS"));

pub mod bit;
pub mod int;
Expand Down