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

rustup: switch to nightly channel #628

Closed
wants to merge 6 commits into from
Closed
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
14 changes: 12 additions & 2 deletions cargo_config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
git-fetch-with-cli = true

[target.@TARGET_CPU@-pc-windows-gnu]
linker = "@CMAKE_INSTALL_PREFIX@/bin/@TARGET_ARCH@-gcc"
linker = "@CMAKE_INSTALL_PREFIX@/bin/@TARGET_ARCH@-g++"
ar = "@CMAKE_INSTALL_PREFIX@/bin/@TARGET_ARCH@-ar"
rustflags = ["-C", "target-cpu=@GCC_ARCH@"]
rustflags = ["-Ctarget-cpu=@GCC_ARCH@", "-Zthreads=@CPU_COUNT@"]

[target.@TARGET_CPU@-pc-windows-gnullvm]
linker = "@CMAKE_INSTALL_PREFIX@/bin/@TARGET_ARCH@-clang++"
ar = "@CMAKE_INSTALL_PREFIX@/bin/@TARGET_ARCH@-ar"
rustflags = ["-Ctarget-cpu=@GCC_ARCH@", "-Zthreads=@CPU_COUNT@"]

[profile.release]
panic = "abort"
strip = true
opt-level = 3
codegen-units = 1

[build]
rustflags = ["-Zthreads=@CPU_COUNT@"]
4 changes: 3 additions & 1 deletion cmake/packages_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if(COMPILER_TOOLCHAIN STREQUAL "gcc")
COMMAND ${EXEC} ${TARGET_ARCH}-objcopy --add-gnu-debuglink=<BINARY_DIR>/mpv.debug <BINARY_DIR>/mpv.exe
COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <BINARY_DIR>/mpv.com
COMMAND ${EXEC} ${TARGET_ARCH}-strip -s <BINARY_DIR>/libmpv-2.dll)
set(rust_target "gnu")
elseif(COMPILER_TOOLCHAIN STREQUAL "clang")
set(vapoursynth_pkgconfig_libs "-lVapourSynth -Wl,-delayload=VapourSynth.dll")
set(vapoursynth_script_pkgconfig_libs "-lVSScript -Wl,-delayload=VSScript.dll")
Expand All @@ -20,9 +21,10 @@ elseif(COMPILER_TOOLCHAIN STREQUAL "clang")
set(ffmpeg_hardcoded_tables "--enable-hardcoded-tables")
set(mpv_lto_mode "-Db_lto_mode=thin")
set(mpv_copy_debug COMMAND ${CMAKE_COMMAND} -E copy <BINARY_DIR>/mpv.pdb ${CMAKE_CURRENT_BINARY_DIR}/mpv-debug/mpv.pdb)
set(rust_target "gnullvm")
if(CLANG_PACKAGES_LTO)
set(cargo_lto_rustflags "CARGO_PROFILE_RELEASE_LTO=thin
RUSTFLAGS='-C linker-plugin-lto -C embed-bitcode -C lto=thin'")
RUSTFLAGS='-Ctarget-cpu=${GCC_ARCH} -Clinker-plugin-lto=yes -Cembed-bitcode=yes -C lto=thin -Zthreads=${CPU_COUNT}'")
set(ffmpeg_lto "--enable-lto=thin")
set(x264_lto "--enable-lto")
if(GCC_ARCH_HAS_AVX)
Expand Down
4 changes: 2 additions & 2 deletions packages/libdovi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ ExternalProject_Add(libdovi
CONFIGURE_COMMAND ""
BUILD_COMMAND ${EXEC}
CARGO_BUILD_TARGET_DIR=<BINARY_DIR>
CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
${cargo_lto_rustflags}
cargo cinstall
--manifest-path <SOURCE_DIR>/dolby_vision/Cargo.toml
--prefix ${MINGW_INSTALL_PREFIX}
--target ${TARGET_CPU}-pc-windows-gnu
--target ${TARGET_CPU}-pc-windows-${rust_target}
-Z build-std=std,panic_abort,core,alloc
--release
--library-type staticlib
INSTALL_COMMAND ""
Expand Down
4 changes: 2 additions & 2 deletions packages/rav1e.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ ExternalProject_Add(rav1e
CONFIGURE_COMMAND ""
BUILD_COMMAND ${EXEC}
CARGO_BUILD_TARGET_DIR=<BINARY_DIR>
CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
CARGO_PROFILE_RELEASE_DEBUG=false
CARGO_PROFILE_RELEASE_INCREMENTAL=false
CARGO_PROFILE_RELEASE_LTO=off
${cargo_lto_rustflags}
cargo cinstall
--manifest-path <SOURCE_DIR>/Cargo.toml
--prefix ${MINGW_INSTALL_PREFIX}
--target ${TARGET_CPU}-pc-windows-gnu
--target ${TARGET_CPU}-pc-windows-${rust_target}
-Z build-std=std,panic_abort,core,alloc
--release
--crt-static
--library-type staticlib
Expand Down
4 changes: 2 additions & 2 deletions toolchain/llvm/llvm-compiler.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
PROG=@CMAKE_INSTALL_PREFIX@/bin/@clang_compiler@
TARGET=@TARGET_ARCH@
FLAGS="$FLAGS -target $TARGET -march=@GCC_ARCH@ -mtune=@M_TUNE@"
TARGET=@TARGET_CPU@
FLAGS="$FLAGS -target $TARGET-pc-windows-gnu -march=@GCC_ARCH@ -mtune=@M_TUNE@"
FLAGS="$FLAGS @driver_mode@ --sysroot @MINGW_INSTALL_PREFIX@"
FLAGS="$FLAGS -fuse-ld=lld --ld-path=@TARGET_ARCH@-ld"
FLAGS="$FLAGS -Wno-unused-command-line-argument"
Expand Down
3 changes: 2 additions & 1 deletion toolchain/rustup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ ExternalProject_Add(rustup
SOURCE_DIR rustup-prefix/src
CONFIGURE_COMMAND ${EXEC} CONF=1
curl -sSf https://sh.rustup.rs |
sh -s -- -y --default-toolchain stable --target x86_64-pc-windows-gnu,i686-pc-windows-gnu --no-modify-path --profile minimal
sh -s -- -y --default-toolchain nightly --no-modify-path --profile minimal
BUILD_COMMAND ${EXEC} rustup update
COMMAND ${EXEC} rustup component add rust-src
INSTALL_COMMAND ${EXEC} cargo install cargo-c --profile=release-strip --features=vendored-openssl
LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
)
Expand Down