@@ -23,23 +23,26 @@ pub fn build(b: *std.Build) !void {
2323 const upstream = b .dependency ("upstream" , .{ .target = target , .optimize = optimize });
2424
2525 const config_ext = b .addConfigHeader (
26- .{ .style = .{ .autoconf = upstream .path ("src/include/pg_config_ext.h.in" ) }, .include_path = "pg_config_ext.h" },
26+ .{ .style = .{ .autoconf_undef = upstream .path ("src/include/pg_config_ext.h.in" ) }, .include_path = "pg_config_ext.h" },
2727 .{ .PG_INT64_TYPE = .@"long int" },
2828 );
2929 const pg_config = b .addConfigHeader (
30- .{ .style = .{ .autoconf = upstream .path ("src/include/pg_config.h.in" ) }, .include_path = "pg_config.h" },
30+ .{ .style = .{ .autoconf_undef = upstream .path ("src/include/pg_config.h.in" ) }, .include_path = "pg_config.h" },
3131 autoconf ,
3232 );
3333 const config_os = b .addConfigHeader (
34- .{ .style = .{ .autoconf = upstream .path (os_header ) }, .include_path = "pg_config_os.h" },
34+ .{ .style = .{ .autoconf_at = upstream .path (os_header ) }, .include_path = "pg_config_os.h" },
3535 .{},
3636 );
3737 const config_path = b .addConfigHeader (
3838 .{ .style = .blank , .include_path = "pg_config_paths.h" },
3939 default_paths ,
4040 );
4141
42- const lib = b .addStaticLibrary (.{ .name = "pq" , .target = target , .optimize = optimize });
42+ const lib = b .addLibrary (.{
43+ .name = "pq" ,
44+ .root_module = b .createModule (.{ .target = target , .optimize = optimize }),
45+ });
4346
4447 lib .addCSourceFiles (.{
4548 .root = upstream .path (libpq_path ),
@@ -252,11 +255,11 @@ pub fn build(b: *std.Build) !void {
252255 // Build executables to ensure no symbols are left undefined
253256 const test_step = b .step ("examples" , "Build example programs" );
254257
255- const test1 = b .addExecutable (.{ .name = "testlibpq" , .target = target , .optimize = optimize });
256- const test2 = b .addExecutable (.{ .name = "testlibpq2" , .target = target , .optimize = optimize });
257- const test3 = b .addExecutable (.{ .name = "testlibpq3" , .target = target , .optimize = optimize });
258- const test4 = b .addExecutable (.{ .name = "testlibpq4" , .target = target , .optimize = optimize });
259- const test5 = b .addExecutable (.{ .name = "testlo" , .target = target , .optimize = optimize });
258+ const test1 = b .addExecutable (.{ .name = "testlibpq" , .root_module = b . createModule (.{ . target = target , .optimize = optimize }) });
259+ const test2 = b .addExecutable (.{ .name = "testlibpq2" , .root_module = b . createModule (.{ . target = target , .optimize = optimize }) });
260+ const test3 = b .addExecutable (.{ .name = "testlibpq3" , .root_module = b . createModule (.{ . target = target , .optimize = optimize }) });
261+ const test4 = b .addExecutable (.{ .name = "testlibpq4" , .root_module = b . createModule (.{ . target = target , .optimize = optimize }) });
262+ const test5 = b .addExecutable (.{ .name = "testlo" , .root_module = b . createModule (.{ . target = target , .optimize = optimize }) });
260263
261264 test1 .addCSourceFiles (.{ .root = upstream .path ("src/test/examples" ), .files = &.{"testlibpq.c" } });
262265 test2 .addCSourceFiles (.{ .root = upstream .path ("src/test/examples" ), .files = &.{"testlibpq2.c" } });
0 commit comments