Skip to content

Commit

Permalink
swallowed facil.io into zap
Browse files Browse the repository at this point in the history
  • Loading branch information
renerocksai committed Dec 19, 2023
1 parent d5a1024 commit f3aefee
Show file tree
Hide file tree
Showing 101 changed files with 51,515 additions and 54 deletions.
35 changes: 8 additions & 27 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,40 +1,21 @@
const std = @import("std");
const build_facilio = @import("facil.io/build.zig").build_facilio;

pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{});
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const optimize = b.standardOptimizeOption(.{});

const facil_dep = b.dependency("facil.io", .{
.target = target,
.optimize = optimize,
});

// create a module to be used internally.
var zap_module = b.createModule(.{
.source_file = .{ .path = "src/zap.zig" },
});

// register the module so it can be referenced
// using the package manager.
// TODO: How to automatically integrate the
// facil.io dependency with the module?
// register the module so it can be referenced using the package manager.
try b.modules.put(b.dupe("zap"), zap_module);

const facil_lib = b.addStaticLibrary(.{
.name = "facil.io",
.target = target,
.optimize = optimize,
});

facil_lib.linkLibrary(facil_dep.artifact("facil.io"));

// we install the facil dependency, just to see what it's like
// zig build with the default (install) step will install it
facil_lib.installLibraryHeaders(facil_dep.artifact("facil.io"));
const facil_install_step = b.addInstallArtifact(facil_lib, .{});
b.getInstallStep().dependOn(&facil_install_step.step);
const facilio = try build_facilio("facil.io", b, target, optimize);

const all_step = b.step("all", "build all examples");

Expand Down Expand Up @@ -89,7 +70,7 @@ pub fn build(b: *std.build.Builder) !void {
.optimize = optimize,
});

example.linkLibrary(facil_dep.artifact("facil.io"));
example.linkLibrary(facilio);
example.addModule("zap", zap_module);

// const example_run = example.run();
Expand Down Expand Up @@ -122,7 +103,7 @@ pub fn build(b: *std.build.Builder) !void {
.target = target,
.optimize = optimize,
});
auth_tests.linkLibrary(facil_dep.artifact("facil.io"));
auth_tests.linkLibrary(facilio);
auth_tests.addModule("zap", zap_module);

const run_auth_tests = b.addRunArtifact(auth_tests);
Expand All @@ -135,7 +116,7 @@ pub fn build(b: *std.build.Builder) !void {
.target = target,
.optimize = optimize,
});
mustache_tests.linkLibrary(facil_dep.artifact("facil.io"));
mustache_tests.linkLibrary(facilio);
mustache_tests.addModule("zap", zap_module);

const run_mustache_tests = b.addRunArtifact(mustache_tests);
Expand All @@ -149,7 +130,7 @@ pub fn build(b: *std.build.Builder) !void {
.optimize = optimize,
});

httpparams_tests.linkLibrary(facil_dep.artifact("facil.io"));
httpparams_tests.linkLibrary(facilio);
httpparams_tests.addModule("zap", zap_module);
const run_httpparams_tests = b.addRunArtifact(httpparams_tests);
// TODO: for some reason, tests aren't run more than once unless
Expand All @@ -166,7 +147,7 @@ pub fn build(b: *std.build.Builder) !void {
.optimize = optimize,
});

sendfile_tests.linkLibrary(facil_dep.artifact("facil.io"));
sendfile_tests.linkLibrary(facilio);
sendfile_tests.addModule("zap", zap_module);
const run_sendfile_tests = b.addRunArtifact(sendfile_tests);
const install_sendfile_tests = b.addInstallArtifact(sendfile_tests, .{});
Expand Down
12 changes: 1 addition & 11 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
.{
.name = "zap",
.version = "0.1.14-pre",

.dependencies = .{
.@"facil.io" = .{
.url = "https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.12.tar.gz",
.hash = "12200301960bbde64052db068cf31a64091ce1f671898513d9b8d9e2be5b0e4b13a3",
}
}
}
.{ .name = "zap", .version = "0.2.0" }
11 changes: 0 additions & 11 deletions build.zig.zon.localhost

This file was deleted.

20 changes: 20 additions & 0 deletions facil.io/.clang_complete
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-Ilib/
-Ilib/facil
-Ilib/facil/fiobj
-Ilib/facil/cli
-Ilib/facil/http/
-Ilib/facil/http/parsers
-Ilib/facil/redis
-Ilib/facil/tls
-Ilib/bearssl

-Idev/
-Idev/startup
-Idev/services
-Idev/http

-DDEBUG
-DHAVE_BEARSSL
-DHAVE_OPENSSL
-DHAVE_ZLIB
-DINCLUDE_MUSTACHE_IMPLEMENTATION
17 changes: 17 additions & 0 deletions facil.io/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: c
script:
- make vars
- DEBUG=1 make vars
- make test/optimized
- ASAN_OPTIONS=detect_leaks=0 make test/poll
- ASAN_OPTIONS=detect_leaks=0 make test/ci
os:
- linux
- osx
compiler:
- clang
- gcc
notifications:
email: false
after_success:
- bash <(curl -s https://codecov.io/bash)
Loading

0 comments on commit f3aefee

Please sign in to comment.