From ad3b78a80634c68ed8d145007aba047ba84b7c83 Mon Sep 17 00:00:00 2001 From: Matheus Catarino Date: Mon, 2 Sep 2024 11:30:04 -0300 Subject: [PATCH] tests: fix macos target --- build.zig | 23 +++++++++++++++++------ build.zig.zon | 36 ++++++++++++++++++++++++++++++++++++ tests/build.zig | 7 +++++-- tests/include_all.cc | 4 ++-- update_zon.sh | 9 +++++++++ 5 files changed, 69 insertions(+), 10 deletions(-) diff --git a/build.zig b/build.zig index ab9d104..8ae9964 100644 --- a/build.zig +++ b/build.zig @@ -54,7 +54,7 @@ const boost_libs = [_][]const u8{ "unordered", "static_string", "io", - "json", + "json", // (no header-only) "type_index", "type_erasure", "typeof", @@ -62,11 +62,11 @@ const boost_libs = [_][]const u8{ "timer", "stacktrace", "sort", - "filesystem", - "context", + "filesystem", // no header-only + "context", // cpp + asm (no header-only) "signals2", "interprocess", - "container", + "container", // no header-only "variant", "variant2", "winapi", @@ -81,7 +81,7 @@ const boost_libs = [_][]const u8{ "function", "spirit", "function_types", - "cobalt", + "cobalt", // need boost.context & boost.asio (no header-only) "phoenix", "nowide", "locale", @@ -94,9 +94,18 @@ const boost_libs = [_][]const u8{ "tokenizer", "geometry", "crc", + "hof", + "interval", + "local_function", "callable_traits", "compat", "bimap", + "conversion", + "charconv", + "log", + "heap", + "msm", + "coroutine2", // need boost.context (no header-only) }; pub fn build(b: *std.Build) !void { @@ -169,8 +178,10 @@ pub fn boostLibraries(b: *std.Build, config: Config) *std.Build.Step.Compile { } if (lib.rootModuleTarget().abi == .msvc) lib.linkLibC() - else + else { + lib.defineCMacro("_GNU_SOURCE", null); lib.linkLibCpp(); + } return lib; } diff --git a/build.zig.zon b/build.zig.zon index 20e2427..51f1b5e 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -386,6 +386,42 @@ .url = "git+https://github.com/boostorg/function_types#boost-1.86.0", .hash = "1220f599b1bb1592228351732048027d2ada614198be92c4972fc3fe811a698201ce", }, + .hof = .{ + .url = "git+https://github.com/boostorg/hof#boost-1.86.0", + .hash = "122037bcf50bf4efff438cb79b5f772fab327204bd274dca073b26a61b5c2aedce64", + }, + .interval = .{ + .url = "git+https://github.com/boostorg/interval#boost-1.86.0", + .hash = "12209e07aff7ae68cdab4bac7c8fd385ce4f60a16e216b83f25ea2e23fda2c13cb7a", + }, + .local_function = .{ + .url = "git+https://github.com/boostorg/local_function#boost-1.86.0", + .hash = "1220ede64f13a619d5c1aeaf0029fd4a330563eb23c756c77b28679620b1758bb167", + }, + .log = .{ + .url = "git+https://github.com/boostorg/log#boost-1.86.0", + .hash = "122047b497d7a5cd30b383c17eb2d79e82256a87153b037048b4a520cc8ed23b5e4b", + }, + .charconv = .{ + .url = "git+https://github.com/boostorg/charconv#boost-1.86.0", + .hash = "12201ef391b90782296ba73b941038d7fb050cda2e6dd89c8547067c6c96548b967e", + }, + .conversion = .{ + .url = "git+https://github.com/boostorg/conversion#boost-1.86.0", + .hash = "12202fb2565a71313d2528944c2d24cd310322acdb6f37fe8a17f3dcd84d54f4e06b", + }, + .heap = .{ + .url = "git+https://github.com/boostorg/heap#boost-1.86.0", + .hash = "12204ae3e10fd18b59f286e7f7aebd7ef34455aea9d780d28eba28c1707bf89a246e", + }, + .msm = .{ + .url = "git+https://github.com/boostorg/msm#boost-1.86.0", + .hash = "1220af97e5583ec57181cf7db6d7e8b8e781c80a5befb9cd4300758007faf5b2ddd0", + }, + .coroutine2 = .{ + .url = "git+https://github.com/boostorg/coroutine2#boost-1.86.0", + .hash = "1220493d37eb17822028b1ec196eed9e5d92ef5549cc1a893cccc216406afdb06207", + }, }, .paths = .{""}, } diff --git a/tests/build.zig b/tests/build.zig index b8345c4..96b8809 100644 --- a/tests/build.zig +++ b/tests/build.zig @@ -48,14 +48,17 @@ fn buildTests(b: *std.Build, options: struct { exe.addCSourceFile(.{ .file = b.path(file), .flags = &.{ - "-std=c++20", "-Wall", - "-Wextra", "-Wpedantic", + "-std=c++20", + "-Wall", + "-Wextra", + "-Wpedantic", "-Wformat", }, }); } if (exe.rootModuleTarget().abi != .msvc) { exe.linkLibCpp(); + exe.defineCMacro("_GNU_SOURCE", null); } else { exe.linkLibC(); } diff --git a/tests/include_all.cc b/tests/include_all.cc index 953faa5..e9afafc 100644 --- a/tests/include_all.cc +++ b/tests/include_all.cc @@ -1,10 +1,11 @@ +#define BOOST_BIND_GLOBAL_PLACEHOLDERS + #include #include #include #include #include #include -#include #include #include #include @@ -13,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/update_zon.sh b/update_zon.sh index 33f2e43..4a1ad03 100755 --- a/update_zon.sh +++ b/update_zon.sh @@ -100,6 +100,15 @@ GIT_URLS=( "git+https://github.com/boostorg/typeof#$BOOST_VERSION" "git+https://github.com/boostorg/units#$BOOST_VERSION" "git+https://github.com/boostorg/function_types#$BOOST_VERSION" + "git+https://github.com/boostorg/hof#$BOOST_VERSION" + "git+https://github.com/boostorg/interval#$BOOST_VERSION" + "git+https://github.com/boostorg/local_function#$BOOST_VERSION" + "git+https://github.com/boostorg/log#$BOOST_VERSION" + "git+https://github.com/boostorg/charconv#$BOOST_VERSION" + "git+https://github.com/boostorg/conversion#$BOOST_VERSION" + "git+https://github.com/boostorg/heap#$BOOST_VERSION" + "git+https://github.com/boostorg/msm#$BOOST_VERSION" + "git+https://github.com/boostorg/coroutine2#$BOOST_VERSION" ## Add more URLs here )