diff --git a/README.md b/README.md index e9365a5..150626c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,9 @@ Project-Specific Options: -Diostreams=[bool] Build boost.iostreams library (default: false) -Djson=[bool] Build boost.json library (default: false) -Dlog=[bool] Build boost.log library (default: false) + -Dnowide=[bool] Build boost.nowide library (default: false) -Dprocess=[bool] Build boost.process library (default: false) + -Dpython=[bool] Build boost.python library (default: false) -Drandom=[bool] Build boost.random library (default: false) -Dregex=[bool] Build boost.regex library (default: false) -Dserialization=[bool] Build boost.serialization library (default: false) diff --git a/build.zig b/build.zig index 658c375..8360578 100644 --- a/build.zig +++ b/build.zig @@ -100,9 +100,13 @@ const boost_libs = [_][]const u8{ "local_function", "format", "pool", + "gil", + "python", "proto", "property_tree", "exception", + "property_map", + "property_map_parallel", "multi_index", "callable_traits", "compat", @@ -135,7 +139,9 @@ pub fn build(b: *std.Build) void { .iostreams = b.option(bool, "iostreams", "Build boost.iostreams library (default: false)") orelse false, .json = b.option(bool, "json", "Build boost.json library (default: false)") orelse false, .log = b.option(bool, "log", "Build boost.log library (default: false)") orelse false, + .nowide = b.option(bool, "nowide", "Build boost.nowide library (default: false)") orelse false, .process = b.option(bool, "process", "Build boost.process library (default: false)") orelse false, + .python = b.option(bool, "python", "Build boost.python library (default: false)") orelse false, .random = b.option(bool, "random", "Build boost.random library (default: false)") orelse false, .regex = b.option(bool, "regex", "Build boost.regex library (default: false)") orelse false, .serialization = b.option(bool, "serialization", "Build boost.serialization library (default: false)") orelse false, @@ -230,9 +236,15 @@ pub fn boostLibraries(b: *std.Build, config: Config) *std.Build.Step.Compile { if (module.serialization) { buildSerialization(b, lib); } + if (module.nowide) { + buildNoWide(b, lib); + } if (module.system) { buildSystem(b, lib); } + if (module.python) { + buildPython(b, lib); + } if (module.stacktrace) { buildStacktrace(b, lib); } @@ -274,7 +286,9 @@ const boostLibrariesModules = struct { iostreams: bool = false, json: bool = false, log: bool = false, + nowide: bool = false, process: bool = false, + python: bool = false, random: bool = false, regex: bool = false, stacktrace: bool = false, @@ -953,6 +967,77 @@ fn buildLog(b: *std.Build, obj: *std.Build.Step.Compile) void { }); } +fn buildNoWide(b: *std.Build, obj: *std.Build.Step.Compile) void { + const nwPath = b.dependency("nowide", .{}).path("src"); + + obj.addIncludePath(nwPath); + obj.addCSourceFiles(.{ + .root = nwPath, + .files = &.{ + "console_buffer.cpp", + "cstdio.cpp", + "cstdlib.cpp", + "filebuf.cpp", + "iostream.cpp", + "stat.cpp", + }, + .flags = cxxFlags, + }); +} + +fn buildPython(b: *std.Build, obj: *std.Build.Step.Compile) void { + const pyPath = b.dependency("python", .{}).path("src"); + + obj.linkSystemLibrary("python3"); + obj.addCSourceFiles(.{ + .root = pyPath, + .files = &.{ + "converter/arg_to_python_base.cpp", + "converter/builtin_converters.cpp", + "converter/from_python.cpp", + "converter/registry.cpp", + "converter/type_id.cpp", + "dict.cpp", + "errors.cpp", + "exec.cpp", + "import.cpp", + "list.cpp", + "long.cpp", + "module.cpp", + "object/class.cpp", + "object/enum.cpp", + "object/function.cpp", + "object/function_doc_signature.cpp", + "object/inheritance.cpp", + "object/iterator.cpp", + "object/life_support.cpp", + "object/pickle_support.cpp", + "object/stl_iterator.cpp", + "object_operators.cpp", + "object_protocol.cpp", + "slice.cpp", + "str.cpp", + "tuple.cpp", + "wrapper.cpp", + }, + .flags = cxxFlags, + }); + + // obj.linkSystemLibrary("npymath"); + // obj.addCSourceFiles(.{ + // .root = pyPath, + // .files = &.{ + // "numpy/dtype.cpp", + // "numpy/matrix.cpp", + // "numpy/ndarray.cpp", + // "numpy/numpy.cpp", + // "numpy/scalars.cpp", + // "numpy/ufunc.cpp", + // }, + // .flags = cxxFlags, + // }); +} + fn buildWave(b: *std.Build, obj: *std.Build.Step.Compile) void { const wavePath = b.dependency("wave", .{}).path("src"); diff --git a/build.zig.zon b/build.zig.zon index 0b945da..fcdc302 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -462,6 +462,22 @@ .url = "git+https://github.com/boostorg/multiprecision#boost-1.86.0", .hash = "12200ebfce9b83b9617018a985bbcec75999ea628f438bd7ad9912af5ba795e5411a", }, + .gil = .{ + .url = "git+https://github.com/boostorg/gil#boost-1.86.0", + .hash = "122041474a0277c624c8cf7608d44746cb08c027a0af6687fca27463a2373c62999d", + }, + .python = .{ + .url = "git+https://github.com/boostorg/python#boost-1.86.0", + .hash = "122065876f46e3dfb99e6177bce74a36932dd6e2bec9d645611b94039544cc58998f", + }, + .property_map = .{ + .url = "git+https://github.com/boostorg/property_map#boost-1.86.0", + .hash = "1220a0c9bc02ed543a0a19abec48a327ed926e5009fdf83b77e1d86acd021eef57fc", + }, + .property_map_parallel = .{ + .url = "git+https://github.com/boostorg/property_map_parallel#boost-1.86.0", + .hash = "122001fc1ec7bbcbf86fa2cbcbf6f5ee3f2de247057d9ce7c2fe7527b3070345c7ec", + }, }, .paths = .{""}, } diff --git a/tests/build.zig b/tests/build.zig index 27d0807..2c49591 100644 --- a/tests/build.zig +++ b/tests/build.zig @@ -42,7 +42,8 @@ fn buildTests(b: *std.Build, options: struct { exe.root_module.include_dirs.append(b.allocator, include_dir) catch unreachable; } // if not header-only, link library - exe.linkLibrary(artifact); + if (std.mem.endsWith(u8, exe.name, "server")) + exe.linkLibrary(artifact); } for (options.files) |file| { @@ -65,9 +66,11 @@ fn buildTests(b: *std.Build, options: struct { } // for boost::asio/boost::beast/boost::cobalt - if (exe.rootModuleTarget().os.tag == .windows) { - exe.linkSystemLibrary("ws2_32"); - exe.linkSystemLibrary("mswsock"); + if (std.mem.endsWith(u8, exe.name, "server")) { + if (exe.rootModuleTarget().os.tag == .windows) { + exe.linkSystemLibrary("ws2_32"); + exe.linkSystemLibrary("mswsock"); + } } b.installArtifact(exe); diff --git a/tests/include_all.cc b/tests/include_all.cc index 50f12ae..a0daf56 100644 --- a/tests/include_all.cc +++ b/tests/include_all.cc @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -47,8 +46,6 @@ int main() { std::cout << "Boost version " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << "\n"; - asio::io_context io_service; - testCRC(); testSafeIntegers(); testVariants(); diff --git a/update_zon.sh b/update_zon.sh index 1d27b20..3c098f7 100755 --- a/update_zon.sh +++ b/update_zon.sh @@ -119,6 +119,10 @@ GIT_URLS=( "git+https://github.com/boostorg/random#$BOOST_VERSION" "git+https://github.com/boostorg/dll#$BOOST_VERSION" "git+https://github.com/boostorg/multiprecision#$BOOST_VERSION" + "git+https://github.com/boostorg/gil#$BOOST_VERSION" + "git+https://github.com/boostorg/python#$BOOST_VERSION" + "git+https://github.com/boostorg/property_map#$BOOST_VERSION" + "git+https://github.com/boostorg/property_map_parallel#$BOOST_VERSION" ## Add more URLs here )