mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
cmake: install zig to 'build_dir/stage3' during building
This commit installs Zig to "build_dir/stage3" during building so that distros' can easily find binary and use it for testing/etc. This commit also splits "add_custom_target(stage3 ALL" and command that it invokes, so that it won't retry it during installation, as target will be considered not out-of-date. See also https://www.github.com/ziglang/zig/issues/14240#issuecomment-1374642063
This commit is contained in:
parent
91b4729962
commit
339cae7fd0
2 changed files with 6 additions and 5 deletions
|
|
@ -860,8 +860,12 @@ set(ZIG_BUILD_ARGS
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(stage3 ALL
|
add_custom_target(stage3 ALL
|
||||||
COMMAND zig2 build compile ${ZIG_BUILD_ARGS}
|
DEPENDS "${CMAKE_BINARY_DIR}/stage3/bin/zig"
|
||||||
DEPENDS zig2
|
)
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig"
|
||||||
|
COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
|
||||||
COMMENT STATUS "Building stage3"
|
COMMENT STATUS "Building stage3"
|
||||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -179,9 +179,6 @@ pub fn build(b: *std.Build) !void {
|
||||||
exe.entitlements = entitlements;
|
exe.entitlements = entitlements;
|
||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
|
|
||||||
const compile_step = b.step("compile", "Build the self-hosted compiler");
|
|
||||||
compile_step.dependOn(&exe.step);
|
|
||||||
|
|
||||||
test_step.dependOn(&exe.step);
|
test_step.dependOn(&exe.step);
|
||||||
|
|
||||||
exe.single_threaded = single_threaded;
|
exe.single_threaded = single_threaded;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue