Skip to content

Commit

Permalink
Disable jemalloc on Windows
Browse files Browse the repository at this point in the history
Upstream isn't even compile-testing on Windows ( https://github.com/tikv/jemallocator/blob/main/.github/workflows/main.yml ), so we should disable it as well.

This should fix the build failing with mingw.
  • Loading branch information
tronical committed Mar 5, 2025
1 parent ea17eee commit b625ad9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tools/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ proc-macro2 = "1.0.11"
spin_on = { workspace = true }
itertools = { workspace = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
[target.'cfg(not(target_os = "windows"))'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }
4 changes: 2 additions & 2 deletions tools/compiler/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use i_slint_compiler::*;
use itertools::Itertools;
use std::io::{BufWriter, Write};

#[cfg(all(feature = "jemalloc", not(target_env = "msvc")))]
#[cfg(all(feature = "jemalloc", not(target_os = "windows")))]
use tikv_jemallocator::Jemalloc;

#[cfg(all(feature = "jemalloc", not(target_env = "msvc")))]
#[cfg(all(feature = "jemalloc", not(target_os = "windows")))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

Expand Down
2 changes: 1 addition & 1 deletion tools/lsp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ i-slint-core = { workspace = true, features = ["std"], optional = true }
slint = { workspace = true, features = ["compat-1-2"], optional = true }
slint-interpreter = { workspace = true, features = ["compat-1-2", "internal", "internal-highlight", "internal-json", "image-default-formats"], optional = true }

[target.'cfg(not(any(target_env = "msvc", target_arch = "wasm32")))'.dependencies]
[target.'cfg(not(any(target_os = "windows", target_arch = "wasm32")))'.dependencies]
tikv-jemallocator = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
Expand Down
4 changes: 2 additions & 2 deletions tools/lsp/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ use std::task::{Poll, Waker};

use crate::common::document_cache::CompilerConfiguration;

#[cfg(not(any(target_env = "msvc", target_arch = "wasm32")))]
#[cfg(not(any(target_os = "windows", target_arch = "wasm32")))]
use tikv_jemallocator::Jemalloc;

#[cfg(not(any(target_env = "msvc", target_arch = "wasm32")))]
#[cfg(not(any(target_os = "windows", target_arch = "wasm32")))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

Expand Down
2 changes: 1 addition & 1 deletion tools/viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ itertools = { workspace = true }
serde_json = { workspace = true }
smol_str = { workspace = true }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
[target.'cfg(not(target_os = "windows"))'.dependencies]
tikv-jemallocator = { workspace = true }

[[bin]]
Expand Down
4 changes: 2 additions & 2 deletions tools/viewer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use std::path::PathBuf;
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{Arc, Mutex};

#[cfg(not(target_env = "msvc"))]
#[cfg(not(target_os = "windows"))]
use tikv_jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[cfg(not(target_os = "windows"))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

Expand Down

0 comments on commit b625ad9

Please sign in to comment.