mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
Merge pull request #204 from lightpanda-io/small-build-improvements
Small build improvements
This commit is contained in:
2
.github/workflows/wpt.yml
vendored
2
.github/workflows/wpt.yml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "build.zig"
|
||||
- "src/**/*.zig"
|
||||
- "src/*.zig"
|
||||
- "tests/wpt/**"
|
||||
@@ -26,6 +27,7 @@ on:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
paths:
|
||||
- "build.zig"
|
||||
- "src/**/*.zig"
|
||||
- "src/*.zig"
|
||||
- "tests/wpt/**"
|
||||
|
||||
1
.github/workflows/zig-fmt.yml
vendored
1
.github/workflows/zig-fmt.yml
vendored
@@ -11,6 +11,7 @@ on:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
paths:
|
||||
- "build.zig"
|
||||
- "src/**/*.zig"
|
||||
- "src/*.zig"
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
|
||||
2
.github/workflows/zig-test.yml
vendored
2
.github/workflows/zig-test.yml
vendored
@@ -8,6 +8,7 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "build.zig"
|
||||
- "src/**/*.zig"
|
||||
- "src/*.zig"
|
||||
- "vendor/jsruntime-lib"
|
||||
@@ -21,6 +22,7 @@ on:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
|
||||
paths:
|
||||
- "build.zig"
|
||||
- "src/**/*.zig"
|
||||
- "src/*.zig"
|
||||
- "vendor/**"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Browsercore is written with [Zig](https://ziglang.org/) `0.11.0`. You have to
|
||||
Browsercore is written with [Zig](https://ziglang.org/) `0.12`. You have to
|
||||
install it with the right version in order to build the project.
|
||||
|
||||
Browsercore also depends on
|
||||
|
||||
12
build.zig
12
build.zig
@@ -44,7 +44,6 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
|
||||
// run
|
||||
const run_cmd = b.addRunArtifact(exe);
|
||||
run_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
run_cmd.addArgs(args);
|
||||
}
|
||||
@@ -65,12 +64,9 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
});
|
||||
try common(shell, options);
|
||||
try jsruntime_pkgs.add_shell(shell);
|
||||
// do not install shell binary
|
||||
b.installArtifact(shell);
|
||||
|
||||
// run
|
||||
const shell_cmd = b.addRunArtifact(shell);
|
||||
shell_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
shell_cmd.addArgs(args);
|
||||
}
|
||||
@@ -110,7 +106,6 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
|
||||
// run
|
||||
const wpt_cmd = b.addRunArtifact(wpt);
|
||||
wpt_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
wpt_cmd.addArgs(args);
|
||||
}
|
||||
@@ -133,7 +128,6 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
|
||||
// run
|
||||
const get_cmd = b.addRunArtifact(get);
|
||||
get_cmd.step.dependOn(b.getInstallStep());
|
||||
if (b.args) |args| {
|
||||
get_cmd.addArgs(args);
|
||||
}
|
||||
@@ -143,7 +137,7 @@ pub fn build(b: *std.build.Builder) !void {
|
||||
}
|
||||
|
||||
fn common(
|
||||
step: *std.Build.CompileStep,
|
||||
step: *std.Build.Step.Compile,
|
||||
options: jsruntime.Options,
|
||||
) !void {
|
||||
try jsruntime_pkgs.add(step, options);
|
||||
@@ -157,7 +151,7 @@ fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
||||
step.addIncludePath(.{ .path = "vendor/libiconv/include" });
|
||||
|
||||
// netsurf libs
|
||||
const ns = "vendor/netsurf/";
|
||||
const ns = "vendor/netsurf";
|
||||
const libs: [4][]const u8 = .{
|
||||
"libdom",
|
||||
"libhubbub",
|
||||
@@ -166,7 +160,7 @@ fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
||||
};
|
||||
inline for (libs) |lib| {
|
||||
step.addObjectFile(.{ .path = ns ++ "/lib/" ++ lib ++ ".a" });
|
||||
step.addIncludePath(.{ .path = ns ++ lib ++ "/src" });
|
||||
step.addIncludePath(.{ .path = ns ++ "/" ++ lib ++ "/src" });
|
||||
}
|
||||
step.addIncludePath(.{ .path = ns ++ "/include" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user