Skip to content

Commit 4d286ef

Browse files
committed
Initial commit
0 parents  commit 4d286ef

4 files changed

Lines changed: 2594 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TA-Lib
2+
3+
This is a Zig wrapper for [TA-LIB](http://ta-lib.org).

build.zig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const std = @import("std");
2+
3+
pub fn build(b: *std.Build) void {
4+
const target = b.standardTargetOptions(.{});
5+
const optimize = b.standardOptimizeOption(.{});
6+
7+
const mod = b.createModule(.{
8+
.root_source_file = b.path("src/root.zig"),
9+
.target = target,
10+
.optimize = optimize,
11+
});
12+
13+
const lib = b.addLibrary(.{
14+
.name = "ta-lib",
15+
.root_module = mod,
16+
.linkage = .static,
17+
});
18+
lib.addIncludePath(.{ .cwd_relative = "/opt/homebrew/opt/ta-lib/include" });
19+
lib.addLibraryPath(.{ .cwd_relative = "/opt/homebrew/opt/ta-lib/lib" });
20+
lib.linkSystemLibrary("ta-lib");
21+
lib.linkLibC();
22+
23+
b.installArtifact(lib);
24+
25+
const tests = b.addTest(.{
26+
.root_module = mod,
27+
});
28+
tests.addIncludePath(.{ .cwd_relative = "/opt/homebrew/opt/ta-lib/include" });
29+
tests.addLibraryPath(.{ .cwd_relative = "/opt/homebrew/opt/ta-lib/lib" });
30+
tests.linkSystemLibrary("ta-lib");
31+
tests.linkLibC();
32+
33+
const run_tests = b.addRunArtifact(tests);
34+
35+
const test_step = b.step("test", "Run unit tests");
36+
test_step.dependOn(&run_tests.step);
37+
}

build.zig.zon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.{
2+
.name = .ta_lib,
3+
.version = "0.0.1",
4+
.minimum_zig_version = "0.15.1",
5+
.paths = .{""},
6+
.fingerprint = 0x40034da37ce4afda,
7+
}

0 commit comments

Comments
 (0)