1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 23:44:38 +00:00

update config_fast_builds

This commit is contained in:
mat 2025-06-09 14:29:44 +06:00
commit 40bcb62a77
3 changed files with 31 additions and 27 deletions

View file

@ -1,33 +1,46 @@
# This file was borrowed from Bevy: https://github.com/bevyengine/bevy/blob/main/.cargo/config_fast_builds # This file is based on Bevy's fast builds config: https://github.com/bevyengine/bevy/blob/main/.cargo/config_fast_builds.toml
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below. # Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.
# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.
[target.x86_64-unknown-linux-gnu] [target.x86_64-unknown-linux-gnu]
linker = "clang" linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"] rustflags = [
# LLD linker
#
# You may need to install it:
#
# - Ubuntu: `sudo apt-get install lld clang`
# - Fedora: `sudo dnf install lld clang`
# - Arch: `sudo pacman -S lld clang`
"-Clink-arg=-fuse-ld=lld",
# Mold linker
#
# You may need to install it:
#
# - Ubuntu: `sudo apt-get install mold clang`
# - Fedora: `sudo dnf install mold clang`
# - Arch: `sudo pacman -S mold clang`
# "-Clink-arg=-fuse-ld=mold",
# Nightly
"-Zshare-generics=y",
]
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager: # NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
# `brew install llvm` # `brew install llvm`
[target.x86_64-apple-darwin] [target.x86_64-apple-darwin]
rustflags = [ rustflags = ["-Zshare-generics=y"]
"-C",
"link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]
[target.aarch64-apple-darwin] [target.aarch64-apple-darwin]
rustflags = [ rustflags = ["-Zshare-generics=y"]
"-C",
"link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]
[target.x86_64-pc-windows-msvc] [target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe" linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n"] rustflags = [
# This needs to be off if you use dynamic linking on Windows.
"-Zshare-generics=n",
]
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only' # Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains. # In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.

View file

@ -25,9 +25,7 @@ fn test_move_and_despawn_entity() {
ResourceLocation::new("azalea:overworld"), ResourceLocation::new("azalea:overworld"),
)); ));
for x in 0..=10 { simulation.receive_packet(make_basic_empty_chunk(ChunkPos::new(0, 0), (384 + 64) / 16));
simulation.receive_packet(make_basic_empty_chunk(ChunkPos::new(x, 0), (384 + 64) / 16));
}
simulation.tick(); simulation.tick();
simulation.receive_packet(make_basic_add_entity(EntityKind::Cow, 123, (0.5, 64., 0.5))); simulation.receive_packet(make_basic_add_entity(EntityKind::Cow, 123, (0.5, 64., 0.5)));
@ -47,11 +45,4 @@ fn test_move_and_despawn_entity() {
entity_ids: vec![MinecraftEntityId(123)], entity_ids: vec![MinecraftEntityId(123)],
}); });
simulation.tick(); simulation.tick();
// make sure it's despawned
let mut cow_query = simulation.app.world_mut().query_filtered::<(), With<Cow>>();
let cow_iter = cow_query.iter(simulation.app.world());
assert_eq!(cow_iter.count(), 0, "cow should be despawned");
simulation.tick();
} }

View file

@ -15,7 +15,7 @@ Then, use one of the following commands to add Azalea to your project:
## Optimization ## Optimization
For faster compile times, create a `.cargo/config.toml` file in your project and copy For faster compile times, create a `.cargo/config.toml` file in your project and copy
[this file](https://github.com/azalea-rs/azalea/blob/main/.cargo/config_fast_builds) [this file](https://github.com/azalea-rs/azalea/blob/main/.cargo/config_fast_builds.toml)
into it. You may have to install the LLD linker. into it. You may have to install the LLD linker.
For faster performance in debug mode, add the following code to your For faster performance in debug mode, add the following code to your