Skip to content

Commit

Permalink
Fix ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed May 14, 2024
1 parent b4d32a1 commit 076f786
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
deploy:
runs-on: ubuntu-22.04
env:
ZIG_VERSION: 0.11.0
ZIG_VERSION: 0.12.0
steps:
- name: Clone repo.
uses: actions/checkout@v3
Expand Down
22 changes: 5 additions & 17 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ var optStatic: ?bool = undefined;
var optJIT: ?bool = undefined;
var optRT: ?config.Runtime = undefined;

var tcc: *std.Build.Module = undefined;
var linenoise: *std.Build.Module = undefined;
var mimalloc: *std.Build.Module = undefined;

var rtarget: std.Build.ResolvedTarget = undefined;
var target: std.Target = undefined;
var optimize: std.builtin.OptimizeMode = undefined;
Expand All @@ -44,10 +40,6 @@ pub fn build(b: *std.Build) !void {
optRT = b.option(config.Runtime, "rt", "Runtime.");
link_test = b.option(bool, "link-test", "Build test by linking lib. Disable for better stack traces.") orelse true;

tcc = tcc_lib.createModule(b);
mimalloc = mimalloc_lib.createModule(b);
linenoise = createLinenoiseModule(b);

{
const step = b.step("cli", "Build main cli.");

Expand Down Expand Up @@ -244,6 +236,7 @@ pub fn buildAndLinkDeps(mod: *std.Build.Module, build_options: *std.Build.Module
mod.link_libc = true;

if (opts.malloc == .mimalloc) {
const mimalloc = mimalloc_lib.createModule(b);
mod.addImport("mimalloc", mimalloc);
mimalloc_lib.buildAndLink(b, mod, .{
.target = rtarget,
Expand All @@ -260,8 +253,8 @@ pub fn buildAndLinkDeps(mod: *std.Build.Module, build_options: *std.Build.Module
}

if (opts.ffi) {
const tcc_ = tcc_lib.createModule(b);
tcc_lib.addImport(mod, "tcc", tcc_);
const tcc = tcc_lib.createModule(b);
tcc_lib.addImport(mod, "tcc", tcc);
tcc_lib.buildAndLink(b, mod, .{
.selinux = selinux,
.target = rtarget,
Expand All @@ -276,8 +269,8 @@ pub fn buildAndLinkDeps(mod: *std.Build.Module, build_options: *std.Build.Module
}

if (opts.cli and target.os.tag != .windows and target.os.tag != .wasi) {
const linenoise_ = createLinenoiseModule(b);
mod.addImport("linenoise", linenoise_);
const linenoise = createLinenoiseModule(b);
mod.addImport("linenoise", linenoise);
buildAndLinkLinenoise(b, mod);
} else {
mod.addAnonymousImport("linenoise", .{
Expand Down Expand Up @@ -526,11 +519,6 @@ pub fn buildCVM(b: *std.Build, opts: Options) !*std.Build.Step.Compile {
} else {
try cflags.append("-DDEBUG=0");
}
if (optimize == .Debug) {
try cflags.append("-DDEBUG=1");
} else {
try cflags.append("-DDEBUG=0");
}
try cflags.append("-DCGOTO=1");
if (opts.trackGlobalRc) {
try cflags.append("-DTRACK_GLOBAL_RC=1");
Expand Down
Loading

0 comments on commit 076f786

Please sign in to comment.