diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /library/stdarch/ci/dox.sh | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | library/stdarch/ci/dox.sh | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/library/stdarch/ci/dox.sh b/library/stdarch/ci/dox.sh new file mode 100755 index 000000000..e70a32b2d --- /dev/null +++ b/library/stdarch/ci/dox.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Builds documentation for all target triples that we have a registered URL for +# in liblibc. This scrapes the list of triples to document from `src/lib.rs` +# which has a bunch of `html_root_url` directives we pick up. + +set -ex + +rm -rf target/doc +mkdir -p target/doc + +dox() { + local arch=$1 + local target=$2 + + echo "documenting ${arch}" + + if [ "$CI" != "" ]; then + rustup target add "${target}" || true + fi + + 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 \ + --edition=2018 \ + --crate-name core_arch \ + --library-path "target/${target}/debug/deps" \ + --cfg core_arch_docs + rustdoc --verbose --target "${target}" \ + -o "target/doc/${arch}" crates/std_detect/src/lib.rs \ + --edition=2018 \ + --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)" \ + --cfg core_arch_docs +} + +dox i686 i686-unknown-linux-gnu +dox x86_64 x86_64-unknown-linux-gnu +dox arm armv7-unknown-linux-gnueabihf +dox aarch64 aarch64-unknown-linux-gnu +dox powerpc powerpc-unknown-linux-gnu +dox powerpc64le powerpc64le-unknown-linux-gnu +dox mips mips-unknown-linux-gnu +dox mips64 mips64-unknown-linux-gnuabi64 +dox wasm32 wasm32-unknown-unknown |