Skip to content

Commit

Permalink
tests: fix macos target
Browse files Browse the repository at this point in the history
  • Loading branch information
kassane committed Sep 2, 2024
1 parent 24a9ca6 commit ad3b78a
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 10 deletions.
23 changes: 17 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ const boost_libs = [_][]const u8{
"unordered",
"static_string",
"io",
"json",
"json", // (no header-only)
"type_index",
"type_erasure",
"typeof",
"units",
"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",
Expand All @@ -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",
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}

Expand Down
36 changes: 36 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .{""},
}
7 changes: 5 additions & 2 deletions tests/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/include_all.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#define BOOST_BIND_GLOBAL_PLACEHOLDERS

#include <boost/algorithm/algorithm.hpp>
#include <boost/any.hpp>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/callable_traits.hpp>
#include <boost/cobalt.hpp>
#include <boost/config.hpp>
#include <boost/crc.hpp>
#include <boost/date_time.hpp>
Expand All @@ -13,7 +14,6 @@
#include <boost/multi_array.hpp>
#include <boost/numeric/odeint.hpp>
#include <boost/pfr.hpp>
#include <boost/process.hpp>
#include <boost/safe_numerics/safe_integer.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
Expand Down
9 changes: 9 additions & 0 deletions update_zon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit ad3b78a

Please sign in to comment.