Skip to content

Commit dea9d1f

Browse files
authored
Fix removed APIs in std.Build (#9)
+ bump .zigversion
1 parent 5e268ec commit dea9d1f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.zigversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.14.0-dev.1911+3bf89f55c
1+
0.14.0-dev.2563+af5e73172

build.zig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ pub fn build(b: *std.Build) void {
8686
});
8787

8888
if (target.result.os.tag == .windows) {
89-
lib.defineCMacro("IMGUI_API", "__declspec(dllexport)");
90-
lib.defineCMacro("IMPLOT_API", "__declspec(dllexport)");
91-
lib.defineCMacro("ZGUI_API", "__declspec(dllexport)");
89+
lib.root_module.addCMacro("IMGUI_API", "__declspec(dllexport)");
90+
lib.root_module.addCMacro("IMPLOT_API", "__declspec(dllexport)");
91+
lib.root_module.addCMacro("ZGUI_API", "__declspec(dllexport)");
9292
}
9393

9494
if (target.result.os.tag == .macos) {
@@ -106,10 +106,10 @@ pub fn build(b: *std.Build) void {
106106

107107
const emscripten = target.result.os.tag == .emscripten;
108108
if (emscripten) {
109-
imgui.defineCMacro("__EMSCRIPTEN__", null);
109+
imgui.root_module.addCMacro("__EMSCRIPTEN__", "");
110110
// TODO: read from enviroment or `emcc --version`
111-
imgui.defineCMacro("__EMSCRIPTEN_major__", "3");
112-
imgui.defineCMacro("__EMSCRIPTEN_minor__", "1");
111+
imgui.root_module.addCMacro("__EMSCRIPTEN_major__", "3");
112+
imgui.root_module.addCMacro("__EMSCRIPTEN_minor__", "1");
113113
imgui.root_module.stack_protector = false;
114114
//imgui.root_module.disable_stack_probing = true;
115115
}
@@ -147,11 +147,11 @@ pub fn build(b: *std.Build) void {
147147
.file = b.path("libs/imgui/misc/freetype/imgui_freetype.cpp"),
148148
.flags = cflags,
149149
});
150-
imgui.defineCMacro("IMGUI_ENABLE_FREETYPE", "1");
150+
imgui.root_module.addCMacro("IMGUI_ENABLE_FREETYPE", "1");
151151
}
152152

153153
if (options.use_wchar32) {
154-
imgui.defineCMacro("IMGUI_USE_WCHAR32", "1");
154+
imgui.root_module.addCMacro("IMGUI_USE_WCHAR32", "1");
155155
}
156156

157157
if (options.with_implot) {
@@ -206,8 +206,8 @@ pub fn build(b: *std.Build) void {
206206
.flags = cflags,
207207
});
208208

209-
imgui.defineCMacro("IMGUI_ENABLE_TEST_ENGINE", null);
210-
imgui.defineCMacro("IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL", "1");
209+
imgui.root_module.addCMacro("IMGUI_ENABLE_TEST_ENGINE", "");
210+
imgui.root_module.addCMacro("IMGUI_TEST_ENGINE_ENABLE_COROUTINE_STDTHREAD_IMPL", "1");
211211

212212
imgui.addIncludePath(b.path("libs/imgui_test_engine/"));
213213

@@ -254,7 +254,7 @@ pub fn build(b: *std.Build) void {
254254
"-Wall",
255255
"-Wextra",
256256
} });
257-
winpthreads.defineCMacro("__USE_MINGW_ANSI_STDIO", "1");
257+
winpthreads.root_module.addCMacro("__USE_MINGW_ANSI_STDIO", "1");
258258
winpthreads.addIncludePath(b.path("libs/winpthreads/include"));
259259
winpthreads.addIncludePath(b.path("libs/winpthreads/src"));
260260
winpthreads.linkLibC();

0 commit comments

Comments
 (0)