Skip to content

Commit dc929f8

Browse files
authored
feat: add no_opt_arch feature flag (#13)
- Close #12
1 parent 6ea592c commit dc929f8

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ secure = ["libmimalloc-sys2/secure"]
3030
override = ["libmimalloc-sys2/override"]
3131
local_dynamic_tls = ["libmimalloc-sys2/local_dynamic_tls"]
3232
no_thp = ["libmimalloc-sys2/no_thp"]
33+
no_opt_arch = ["libmimalloc-sys2/no_opt_arch"]
3334
extended = ["libmimalloc-sys2/extended"]
3435
skip_collect_on_exit = ["libmimalloc-sys2/skip_collect_on_exit"]
3536

libmimalloc-sys/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ arena = []
3535
local_dynamic_tls = []
3636
no_thp = []
3737
skip_collect_on_exit = []
38+
# turn off `MI_OPT_ARCH`, default is `ON`
39+
no_opt_arch = []
3840

3941
# Show `extended` on docs.rs since it's the full API surface.
4042
[package.metadata.docs.rs]

libmimalloc-sys/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ fn main() {
3838
cmake_config.define("MI_TRACK_ETW", "ON");
3939
}
4040

41+
if env::var_os("CARGO_FEATURE_NO_OPT_ARCH").is_some() {
42+
cmake_config.define("MI_OPT_ARCH", "OFF");
43+
}
44+
4145
// it's complicated to link ucrt in debug mode on windows
4246
if profile == "debug" && target_env != "msvc" {
4347
cmake_config

0 commit comments

Comments
 (0)