| author | |
| committer | |
| log | 339cae7fd0af5730673fcba7d97568af24b5aa4f |
| tree | db25ab71853a1b5a38a63a56968554868d3d9598 |
| parent | 91b4729962ddec96d1ee60d742326da828dae94a |
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-13746420632 files changed, 6 insertions(+), 5 deletions(-)
CMakeLists.txt+6-2| ... | ... | @@ -860,8 +860,12 @@ set(ZIG_BUILD_ARGS |
| 860 | 860 | ) |
| 861 | 861 | |
| 862 | 862 | add_custom_target(stage3 ALL |
| 863 | COMMAND zig2 build compile ${ZIG_BUILD_ARGS} | |
| 864 | DEPENDS zig2 | |
| 863 | DEPENDS "${CMAKE_BINARY_DIR}/stage3/bin/zig" | |
| 864 | ) | |
| 865 | ||
| 866 | add_custom_command( | |
| 867 | OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig" | |
| 868 | COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS} | |
| 865 | 869 | COMMENT STATUS "Building stage3" |
| 866 | 870 | WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" |
| 867 | 871 | ) |
build.zig-3| ... | ... | @@ -179,9 +179,6 @@ pub fn build(b: *std.Build) !void { |
| 179 | 179 | exe.entitlements = entitlements; |
| 180 | 180 | b.installArtifact(exe); |
| 181 | 181 | |
| 182 | const compile_step = b.step("compile", "Build the self-hosted compiler"); | |
| 183 | compile_step.dependOn(&exe.step); | |
| 184 | ||
| 185 | 182 | test_step.dependOn(&exe.step); |
| 186 | 183 | |
| 187 | 184 | exe.single_threaded = single_threaded; |