File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,22 @@ pub fn build(b: *std.Build) void {
88 const shared = b .option (bool , "shared" , "Build the Shared Library [default: false]" ) orelse false ;
99 const tests = b .option (bool , "tests" , "Build tests [default: false]" ) orelse false ;
1010
11- const fmt_dep = b .dependency ("fmt" , .{
12- .target = target ,
13- .optimize = optimize ,
14- });
11+ // zon dependency
12+ const fmt_dep = b .dependency ("fmt" , .{});
1513
16- const lib = if (shared ) b .addSharedLibrary (.{
14+ // build libfmt
15+ const lib = b .addLibrary (.{
1716 .name = "fmt" ,
18- .target = target ,
19- .optimize = optimize ,
17+ .root_module = b .createModule (.{
18+ .target = target ,
19+ .optimize = optimize ,
20+ }),
21+ .linkage = if (shared ) .dynamic else .static ,
2022 .version = .{
2123 .major = 11 ,
2224 .minor = 1 ,
2325 .patch = 4 ,
2426 },
25- }) else b .addStaticLibrary (.{
26- .name = "fmt" ,
27- .target = target ,
28- .optimize = optimize ,
2927 });
3028 lib .addIncludePath (fmt_dep .path ("include" ));
3129 lib .addCSourceFiles (.{
@@ -38,10 +36,13 @@ pub fn build(b: *std.Build) void {
3836 lib .root_module .strip = true ;
3937 if (lib .linkage == .static )
4038 lib .pie = true ;
39+
40+ // MSVC don't build llvm-libc++
4141 if (lib .rootModuleTarget ().abi != .msvc )
4242 lib .linkLibCpp ()
4343 else
4444 lib .linkLibC ();
45+
4546 lib .installHeadersDirectory (fmt_dep .path ("include" ), "" , .{});
4647 b .installArtifact (lib );
4748
You can’t perform that action at this time.
0 commit comments