File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # TA-Lib
2+
3+ This is a Zig wrapper for [ TA-LIB] ( http://ta-lib.org ) .
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ .{
2+ .name = .ta_lib ,
3+ .version = "0.0.1" ,
4+ .minimum_zig_version = "0.15.1" ,
5+ .paths = .{"" },
6+ .fingerprint = 0x40034da37ce4afda ,
7+ }
You can’t perform that action at this time.
0 commit comments