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 libcore build #680

Merged
merged 1 commit into from
Feb 12, 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
9 changes: 7 additions & 2 deletions ci/dox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,24 @@ dox() {
rm -rf "target/doc/${arch}"
mkdir "target/doc/${arch}"

export RUSTFLAGS="--cfg core_arch_docs"
export RUSTDOCFLAGS="--cfg core_arch_docs"

cargo build --verbose --target "${target}" --manifest-path crates/core_arch/Cargo.toml
cargo build --verbose --target "${target}" --manifest-path crates/std_detect/Cargo.toml

rustdoc --verbose --target "${target}" \
-o "target/doc/${arch}" crates/core_arch/src/lib.rs \
--crate-name core_arch \
--library-path "target/${target}/debug/deps"
--library-path "target/${target}/debug/deps" \
--cfg core_arch_docs
rustdoc --verbose --target "${target}" \
-o "target/doc/${arch}" crates/std_detect/src/lib.rs \
--crate-name std_detect \
--library-path "target/${target}/debug/deps" \
--extern cfg_if="$(ls target/"${target}"/debug/deps/libcfg_if-*.rlib)" \
--extern libc="$(ls target/"${target}"/debug/deps/liblibc-*.rlib)"
--extern libc="$(ls target/"${target}"/debug/deps/liblibc-*.rlib)" \
--cfg core_arch_docs
}

dox i686 i686-unknown-linux-gnu
Expand Down
1 change: 1 addition & 0 deletions crates/core_arch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ readme = "README.md"
keywords = ["core", "simd", "arch", "intrinsics"]
categories = ["hardware-support", "no-std"]
license = "MIT/Apache-2.0"
build = "build.rs"

[badges]
travis-ci = { repository = "rust-lang-nursery/stdsimd" }
Expand Down
5 changes: 1 addition & 4 deletions crates/core_arch/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
use std::env;

fn main() {
println!("cargo:rustc-env=TARGET={}", env::var("TARGET").unwrap());
println!("cargo:rerurn-if-changed=build.rs");
println!("cargo:rustc-cfg=core_arch_docs");
}
6 changes: 5 additions & 1 deletion crates/core_arch/src/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ mod macros;

mod simd;

#[doc(include = "core_arch_docs.md")]
#[cfg_attr(
not(core_arch_docs),
doc(include = "../stdsimd/crates/core_arch/src/core_arch_docs.md")
)]
#[cfg_attr(core_arch_docs, doc(include = "core_arch_docs.md"))]
#[stable(feature = "simd_arch", since = "1.27.0")]
pub mod arch {
/// Platform-specific intrinsics for the `x86` platform.
Expand Down