mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +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:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
|
- "build.zig"
|
||||||
- "src/**/*.zig"
|
- "src/**/*.zig"
|
||||||
- "src/*.zig"
|
- "src/*.zig"
|
||||||
- "tests/wpt/**"
|
- "tests/wpt/**"
|
||||||
@@ -26,6 +27,7 @@ on:
|
|||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
|
- "build.zig"
|
||||||
- "src/**/*.zig"
|
- "src/**/*.zig"
|
||||||
- "src/*.zig"
|
- "src/*.zig"
|
||||||
- "tests/wpt/**"
|
- "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]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
|
- "build.zig"
|
||||||
- "src/**/*.zig"
|
- "src/**/*.zig"
|
||||||
- "src/*.zig"
|
- "src/*.zig"
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# 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:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
|
- "build.zig"
|
||||||
- "src/**/*.zig"
|
- "src/**/*.zig"
|
||||||
- "src/*.zig"
|
- "src/*.zig"
|
||||||
- "vendor/jsruntime-lib"
|
- "vendor/jsruntime-lib"
|
||||||
@@ -21,6 +22,7 @@ on:
|
|||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
|
- "build.zig"
|
||||||
- "src/**/*.zig"
|
- "src/**/*.zig"
|
||||||
- "src/*.zig"
|
- "src/*.zig"
|
||||||
- "vendor/**"
|
- "vendor/**"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
### Prerequisites
|
### 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.
|
install it with the right version in order to build the project.
|
||||||
|
|
||||||
Browsercore also depends on
|
Browsercore also depends on
|
||||||
|
|||||||
12
build.zig
12
build.zig
@@ -44,7 +44,6 @@ pub fn build(b: *std.build.Builder) !void {
|
|||||||
|
|
||||||
// run
|
// run
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
run_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
if (b.args) |args| {
|
if (b.args) |args| {
|
||||||
run_cmd.addArgs(args);
|
run_cmd.addArgs(args);
|
||||||
}
|
}
|
||||||
@@ -65,12 +64,9 @@ pub fn build(b: *std.build.Builder) !void {
|
|||||||
});
|
});
|
||||||
try common(shell, options);
|
try common(shell, options);
|
||||||
try jsruntime_pkgs.add_shell(shell);
|
try jsruntime_pkgs.add_shell(shell);
|
||||||
// do not install shell binary
|
|
||||||
b.installArtifact(shell);
|
|
||||||
|
|
||||||
// run
|
// run
|
||||||
const shell_cmd = b.addRunArtifact(shell);
|
const shell_cmd = b.addRunArtifact(shell);
|
||||||
shell_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
if (b.args) |args| {
|
if (b.args) |args| {
|
||||||
shell_cmd.addArgs(args);
|
shell_cmd.addArgs(args);
|
||||||
}
|
}
|
||||||
@@ -110,7 +106,6 @@ pub fn build(b: *std.build.Builder) !void {
|
|||||||
|
|
||||||
// run
|
// run
|
||||||
const wpt_cmd = b.addRunArtifact(wpt);
|
const wpt_cmd = b.addRunArtifact(wpt);
|
||||||
wpt_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
if (b.args) |args| {
|
if (b.args) |args| {
|
||||||
wpt_cmd.addArgs(args);
|
wpt_cmd.addArgs(args);
|
||||||
}
|
}
|
||||||
@@ -133,7 +128,6 @@ pub fn build(b: *std.build.Builder) !void {
|
|||||||
|
|
||||||
// run
|
// run
|
||||||
const get_cmd = b.addRunArtifact(get);
|
const get_cmd = b.addRunArtifact(get);
|
||||||
get_cmd.step.dependOn(b.getInstallStep());
|
|
||||||
if (b.args) |args| {
|
if (b.args) |args| {
|
||||||
get_cmd.addArgs(args);
|
get_cmd.addArgs(args);
|
||||||
}
|
}
|
||||||
@@ -143,7 +137,7 @@ pub fn build(b: *std.build.Builder) !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn common(
|
fn common(
|
||||||
step: *std.Build.CompileStep,
|
step: *std.Build.Step.Compile,
|
||||||
options: jsruntime.Options,
|
options: jsruntime.Options,
|
||||||
) !void {
|
) !void {
|
||||||
try jsruntime_pkgs.add(step, options);
|
try jsruntime_pkgs.add(step, options);
|
||||||
@@ -157,7 +151,7 @@ fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
|||||||
step.addIncludePath(.{ .path = "vendor/libiconv/include" });
|
step.addIncludePath(.{ .path = "vendor/libiconv/include" });
|
||||||
|
|
||||||
// netsurf libs
|
// netsurf libs
|
||||||
const ns = "vendor/netsurf/";
|
const ns = "vendor/netsurf";
|
||||||
const libs: [4][]const u8 = .{
|
const libs: [4][]const u8 = .{
|
||||||
"libdom",
|
"libdom",
|
||||||
"libhubbub",
|
"libhubbub",
|
||||||
@@ -166,7 +160,7 @@ fn linkNetSurf(step: *std.build.LibExeObjStep) void {
|
|||||||
};
|
};
|
||||||
inline for (libs) |lib| {
|
inline for (libs) |lib| {
|
||||||
step.addObjectFile(.{ .path = ns ++ "/lib/" ++ lib ++ ".a" });
|
step.addObjectFile(.{ .path = ns ++ "/lib/" ++ lib ++ ".a" });
|
||||||
step.addIncludePath(.{ .path = ns ++ lib ++ "/src" });
|
step.addIncludePath(.{ .path = ns ++ "/" ++ lib ++ "/src" });
|
||||||
}
|
}
|
||||||
step.addIncludePath(.{ .path = ns ++ "/include" });
|
step.addIncludePath(.{ .path = ns ++ "/include" });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user