@@ -86,9 +86,9 @@ pub fn build(b: *std.Build) void {
86
86
});
87
87
88
88
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)" );
92
92
}
93
93
94
94
if (target .result .os .tag == .macos ) {
@@ -106,10 +106,10 @@ pub fn build(b: *std.Build) void {
106
106
107
107
const emscripten = target .result .os .tag == .emscripten ;
108
108
if (emscripten ) {
109
- imgui .defineCMacro ("__EMSCRIPTEN__" , null );
109
+ imgui .root_module . addCMacro ("__EMSCRIPTEN__" , "" );
110
110
// 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" );
113
113
imgui .root_module .stack_protector = false ;
114
114
//imgui.root_module.disable_stack_probing = true;
115
115
}
@@ -147,11 +147,11 @@ pub fn build(b: *std.Build) void {
147
147
.file = b .path ("libs/imgui/misc/freetype/imgui_freetype.cpp" ),
148
148
.flags = cflags ,
149
149
});
150
- imgui .defineCMacro ("IMGUI_ENABLE_FREETYPE" , "1" );
150
+ imgui .root_module . addCMacro ("IMGUI_ENABLE_FREETYPE" , "1" );
151
151
}
152
152
153
153
if (options .use_wchar32 ) {
154
- imgui .defineCMacro ("IMGUI_USE_WCHAR32" , "1" );
154
+ imgui .root_module . addCMacro ("IMGUI_USE_WCHAR32" , "1" );
155
155
}
156
156
157
157
if (options .with_implot ) {
@@ -206,8 +206,8 @@ pub fn build(b: *std.Build) void {
206
206
.flags = cflags ,
207
207
});
208
208
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" );
211
211
212
212
imgui .addIncludePath (b .path ("libs/imgui_test_engine/" ));
213
213
@@ -254,7 +254,7 @@ pub fn build(b: *std.Build) void {
254
254
"-Wall" ,
255
255
"-Wextra" ,
256
256
} });
257
- winpthreads .defineCMacro ("__USE_MINGW_ANSI_STDIO" , "1" );
257
+ winpthreads .root_module . addCMacro ("__USE_MINGW_ANSI_STDIO" , "1" );
258
258
winpthreads .addIncludePath (b .path ("libs/winpthreads/include" ));
259
259
winpthreads .addIncludePath (b .path ("libs/winpthreads/src" ));
260
260
winpthreads .linkLibC ();
0 commit comments