diff options
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | build.zig | 40 |
2 files changed, 14 insertions, 34 deletions
@@ -676,7 +676,7 @@ build-obj: .PHONY: dev-build-obj-wasm dev-build-obj-wasm: - $(ZIG) build bun-wasm -Dtarget=wasm32-freestanding --prominent-compile-errors + $(ZIG) build bun-wasm -Dtarget=wasm32-freestanding .PHONY: dev-wasm dev-wasm: dev-build-obj-wasm @@ -689,7 +689,7 @@ dev-wasm: dev-build-obj-wasm .PHONY: build-obj-wasm build-obj-wasm: - $(ZIG) build bun-wasm -Doptimize=ReleaseFast -Dtarget=wasm32-freestanding --prominent-compile-errors + $(ZIG) build bun-wasm -Doptimize=ReleaseFast -Dtarget=wasm32-freestanding emcc -sEXPORTED_FUNCTIONS="['_bun_free', '_cycleStart', '_cycleEnd', '_bun_malloc', '_scan', '_transform', '_init']" \ -g -s ERROR_ON_UNDEFINED_SYMBOLS=0 -DNDEBUG \ $(BUN_DEPS_DIR)/libmimalloc.a.wasm \ @@ -699,7 +699,7 @@ build-obj-wasm: .PHONY: build-obj-wasm-small build-obj-wasm-small: - $(ZIG) build bun-wasm -Doptimize=ReleaseSmall -Dtarget=wasm32-freestanding --prominent-compile-errors + $(ZIG) build bun-wasm -Doptimize=ReleaseSmall -Dtarget=wasm32-freestanding emcc -sEXPORTED_FUNCTIONS="['_bun_free', '_cycleStart', '_cycleEnd', '_bun_malloc', '_scan', '_transform', '_init']" \ -g -s ERROR_ON_UNDEFINED_SYMBOLS=0 -DNDEBUG \ $(BUN_DEPS_DIR)/libmimalloc.a.wasm \ @@ -1082,7 +1082,7 @@ release-bin-dir: .PHONY: dev-obj dev-obj: - $(ZIG) build obj --prominent-compile-errors -freference-trace -Dcpu="$(CPU_TARGET)" + $(ZIG) build obj -freference-trace -Dcpu="$(CPU_TARGET)" .PHONY: dev-obj-linux dev-obj-linux: @@ -1,4 +1,5 @@ const std = @import("std"); +const Output = @import("src/output.zig"); fn moduleSource(comptime out: []const u8) FileSource { if (comptime std.fs.path.dirname(@src().file)) |base| { @@ -143,11 +144,6 @@ const FileSource = std.build.FileSource; const Module = std.build.Module; const fs = std.fs; -const l = enum { - Hello, - Enum, -}; - pub fn build(b: *Build) !void { // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which @@ -217,7 +213,6 @@ pub fn build(b: *Build) !void { .{ .major = 0, .minor = 0, .patch = 0 }; var obj_step = b.step("obj", "Build bun as a .o file"); - obj_step.dependOn(&b.addLog("Output: {s}/{s}\n", .{ output_dir, bun_executable_name }).step); var obj = b.addObject(.{ .name = bun_executable_name, .root_source_file = FileSource.relative(root_src), @@ -284,22 +279,16 @@ pub fn build(b: *Build) !void { obj.target.cpu_model = .{ .explicit = &std.Target.aarch64.cpu.generic }; } - { - obj_step.dependOn(&b.addLog( - "Build {s} v{} - v{} ({s})\n", - .{ - triplet, - min_version, - max_version, - obj.target.getCpuModel().name, - }, - ).step); - } + std.log.info("Build {s} v{} - v{} ({s})", .{ + triplet, + min_version, + max_version, + obj.target.getCpuModel().name, + }); + std.log.info("Output: {s}/{s}\n", .{ output_dir, bun_executable_name }); defer obj_step.dependOn(&obj.step); - // obj.setBuildMode(optimize); - var actual_build_options = default_build_options; if (b.option(bool, "generate-sizes", "Generate sizes of things") orelse false) { actual_build_options.sizegen = true; @@ -327,9 +316,6 @@ pub fn build(b: *Build) !void { obj.link_eh_frame_hdr = true; obj.link_function_sections = true; } - - var log_step = b.addLog("Destination: {s}/{s}\n", .{ output_dir, bun_executable_name }); - log_step.step.dependOn(&obj.step); } { @@ -475,14 +461,8 @@ pub fn build(b: *Build) !void { try configureObjectStep(b, headers_obj, @TypeOf(target), target, obj.main_pkg_path.?); try linkObjectFiles(b, headers_obj, target); - { - var before = b.addLog("\x1b[" ++ color_map.get("magenta").? ++ "\x1b[" ++ color_map.get("b").? ++ "[{s} tests]" ++ "\x1b[" ++ color_map.get("d").? ++ " ----\n\n" ++ "\x1b[0m", .{"bun"}); - var after = b.addLog("\x1b[" ++ color_map.get("d").? ++ "–––---\n\n" ++ "\x1b[0m", .{}); - headers_step.dependOn(&before.step); - headers_step.dependOn(&headers_obj.step); - headers_step.dependOn(&after.step); - headers_obj.addOptions("build_options", default_build_options.step(b)); - } + headers_step.dependOn(&headers_obj.step); + headers_obj.addOptions("build_options", default_build_options.step(b)); // var iter = headers_obj.modules.iterator(); // while (iter.next()) |item| { |