From 4ce188def8af61acce1aef5c2bca0481888326b8 Mon Sep 17 00:00:00 2001 From: JD31 Date: Wed, 7 Jan 2026 16:37:59 +0100 Subject: [PATCH] Backends: WebGPU: clarify build failure when attempting to build with Dawn for iOS. (#9155, #9156) --- backends/imgui_impl_wgpu.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backends/imgui_impl_wgpu.cpp b/backends/imgui_impl_wgpu.cpp index 47c31726b..c8722cd4a 100644 --- a/backends/imgui_impl_wgpu.cpp +++ b/backends/imgui_impl_wgpu.cpp @@ -1020,15 +1020,18 @@ void ImGui_ImplWGPU_DebugPrintAdapterInfo(const WGPUAdapter& adapter) #if defined(__APPLE__) // MacOS specific: is necessary to compile with "-x objective-c++" flags // (e.g. using cmake: set_source_files_properties(${IMGUI_DIR}/backends/imgui_impl_wgpu.cpp PROPERTIES COMPILE_FLAGS "-x objective-c++") ) +#include +#if TARGET_OS_OSX #include #include #endif +#endif WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceInfo* info) { WGPUSurfaceDescriptor surface_descriptor = {}; WGPUSurface surface = {}; -#if defined(__APPLE__) +#if defined(__APPLE__) && TARGET_OS_OSX if (strcmp(info->System, "cocoa") == 0) { IM_ASSERT(info->RawWindow != nullptr); @@ -1075,7 +1078,7 @@ WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceI surface = wgpuInstanceCreateSurface(info->Instance, &surface_descriptor); } #else -#error "Unsupported WebGPU native platform!" + fprintf(stderr, "'CreateWGPUSurfaceHelper' is not implemented for this platform\n"); #endif return surface; }