Re-enabled mimalloc for non msvc builds

This commit is contained in:
Ben Wallis 2022-07-09 22:54:01 +01:00
parent 7bd4686187
commit af04843a20
9 changed files with 20 additions and 6 deletions

View File

@ -3,6 +3,12 @@ rustflags = [
"-C", "link-arg=-fuse-ld=gold",
]
[target.x86_64-pc-windows-gnu]
rustflags = [
# Required for mimalloc
"-C", "link-arg=-lpsapi",
]
[alias]
# tools
cmd-doc-gen = "run --features=bin_cmd_doc_gen --bin cmd_doc_gen"

View File

@ -2,5 +2,8 @@
# exports default env variables in CI
export DISABLE_GIT_LFS_CHECK=true
export VELOREN_ASSETS="assets"
# When updating RUSTFLAGS here, windows-x86_64.sh must also be updated as it sets them independently
export RUSTFLAGS="-D warnings"
export SHADERC_LIB_DIR=/shaderc/combined/

View File

@ -2,4 +2,10 @@
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
export VELOREN_USERDATA_STRATEGY=executable
# RUSTFLAGS is set here in addition to env.sh (which is used for all targets not just windows) due to
# https://github.com/rust-lang/cargo/issues/5376 which prevents the windows-specific rustflags set in
# .cargo/config from being applied
export RUSTFLAGS="-D warnings -C link-arg=-lpsapi"
time cargo build --target=x86_64-pc-windows-gnu --release --no-default-features --features default-publish

View File

@ -43,7 +43,7 @@ tracing = { version = "0.1", default-features = false }
ron = {version = "0.7", default-features = false}
serde = {version = "1.0", features = [ "rc", "derive" ]}
[target.'cfg(all(windows, target_env="msvc"))'.dependencies]
[target.'cfg(windows)'.dependencies]
mimalloc = "0.1.29"
[dependencies.tui]

View File

@ -2,7 +2,7 @@
#![deny(clippy::clone_on_ref_ptr)]
#![feature(bool_to_option)]
#[cfg(all(target_os = "windows", target_env = "msvc"))]
#[cfg(target_os = "windows")]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

View File

@ -138,7 +138,7 @@ dispatch = "0.1.4"
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
[target.'cfg(all(windows, target_env="msvc"))'.dependencies]
[target.'cfg(windows)'.dependencies]
mimalloc = "0.1.29"
# Mumble

View File

@ -21,5 +21,5 @@ voxygen-dynlib = {package = "veloren-voxygen-dynlib", path = "../dynlib", option
# Hot Reloading
lazy_static = {version = "1.4.0", optional = true}
[target.'cfg(all(windows, target_env="msvc"))'.dependencies]
[target.'cfg(windows)'.dependencies]
mimalloc = "0.1.29"

View File

@ -4,7 +4,7 @@
#[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))]
compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once");
#[cfg(all(target_os = "windows", target_env = "msvc", feature = "be-dyn-lib"))]
#[cfg(all(target_os = "windows", feature = "be-dyn-lib"))]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

View File

@ -4,7 +4,6 @@
#[cfg(all(
target_os = "windows",
target_env = "msvc",
not(feature = "tracy-memory"),
not(feature = "hot-egui")
))]