mirror of
https://github.com/ziglang/zig.git
synced 2025-01-09 11:45:36 +00:00
Merge pull request #15192 from motiejus/build-release
zig build: change "-Drelease" to "-Doptimize"
This commit is contained in:
commit
0e394cf922
@ -813,9 +813,9 @@ endif()
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
set(ZIG_RELEASE_ARG "")
|
||||
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
set(ZIG_RELEASE_ARG -Drelease)
|
||||
set(ZIG_RELEASE_ARG -Doptimize=ReleaseFast)
|
||||
else()
|
||||
set(ZIG_RELEASE_ARG -Drelease -Dstrip)
|
||||
set(ZIG_RELEASE_ARG -Doptimize=ReleaseFast -Dstrip)
|
||||
endif()
|
||||
if(ZIG_NO_LIB)
|
||||
set(ZIG_NO_LIB_ARG "-Dno-lib")
|
||||
|
@ -13,7 +13,6 @@ const zig_version = std.builtin.Version{ .major = 0, .minor = 11, .patch = 0 };
|
||||
const stack_size = 32 * 1024 * 1024;
|
||||
|
||||
pub fn build(b: *std.Build) !void {
|
||||
const release = b.option(bool, "release", "Build in release mode") orelse false;
|
||||
const only_c = b.option(bool, "only-c", "Translate the Zig compiler to C code, with only the C backend enabled") orelse false;
|
||||
const target = t: {
|
||||
var default_target: std.zig.CrossTarget = .{};
|
||||
@ -22,10 +21,8 @@ pub fn build(b: *std.Build) !void {
|
||||
}
|
||||
break :t b.standardTargetOptions(.{ .default_target = default_target });
|
||||
};
|
||||
const optimize: std.builtin.OptimizeMode = if (release) switch (target.getCpuArch()) {
|
||||
.wasm32 => .ReleaseSmall,
|
||||
else => .ReleaseFast,
|
||||
} else .Debug;
|
||||
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
const single_threaded = b.option(bool, "single-threaded", "Build artifacts that run in single threaded mode");
|
||||
const use_zig_libcxx = b.option(bool, "use-zig-libcxx", "If libc++ is needed, use zig's bundled version, don't try to integrate with the system") orelse false;
|
||||
|
@ -58,7 +58,7 @@ stage3-release/bin/zig build \
|
||||
--prefix stage4-release \
|
||||
-Denable-llvm \
|
||||
-Dno-lib \
|
||||
-Drelease \
|
||||
-Doptimize=ReleaseFast \
|
||||
-Dstrip \
|
||||
-Dtarget=$TARGET \
|
||||
-Duse-zig-libcxx \
|
||||
|
@ -78,7 +78,7 @@ stage3-release/bin/zig build \
|
||||
--prefix stage4-release \
|
||||
-Denable-llvm \
|
||||
-Dno-lib \
|
||||
-Drelease \
|
||||
-Doptimize=ReleaseFast \
|
||||
-Dstrip \
|
||||
-Dtarget=$TARGET \
|
||||
-Duse-zig-libcxx \
|
||||
|
@ -62,7 +62,7 @@ stage3/bin/zig build \
|
||||
--prefix stage4 \
|
||||
-Denable-llvm \
|
||||
-Dno-lib \
|
||||
-Drelease \
|
||||
-Doptimize=ReleaseFast \
|
||||
-Dstrip \
|
||||
-Dtarget=$TARGET \
|
||||
-Duse-zig-libcxx \
|
||||
|
Loading…
Reference in New Issue
Block a user