Skip to content

Commit

Permalink
Add sdl-renderer flag to protect against older SDL versions that do n…
Browse files Browse the repository at this point in the history
…ot have SDL_RenderGeometry
  • Loading branch information
jship committed Dec 14, 2023
1 parent bbe0aa7 commit 84ae150
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions dear-imgui.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ flag sdl
manual:
True

flag sdl-renderer
description:
Enable SDL Renderer backend (requires the SDL_RenderGeometry function available in SDL 2.0.18+).
The sdl configuration flag must also be enabled when using this flag.
default:
False
manual:
True

flag glfw
description:
Enable GLFW backend.
Expand Down Expand Up @@ -240,12 +249,10 @@ library
if flag(sdl)
exposed-modules:
DearImGui.SDL
DearImGui.SDL.Renderer
build-depends:
sdl2
cxx-sources:
imgui/backends/imgui_impl_sdl2.cpp
imgui/backends/imgui_impl_sdlrenderer2.cpp

if os(windows) || os(darwin)
extra-libraries:
Expand All @@ -262,6 +269,12 @@ library
exposed-modules:
DearImGui.SDL.Vulkan

if flag(sdl-renderer)
exposed-modules:
DearImGui.SDL.Renderer
cxx-sources:
imgui/backends/imgui_impl_sdlrenderer2.cpp

if flag(glfw)
exposed-modules:
DearImGui.GLFW
Expand Down Expand Up @@ -365,7 +378,7 @@ executable sdlrenderer
main-is: Renderer.hs
hs-source-dirs: examples/sdl
build-depends: sdl2, dear-imgui, managed, text
if (!flag(examples) || !flag(sdl))
if (!flag(examples) || !flag(sdl) || !flag(sdl-renderer))
buildable: False

executable vulkan
Expand Down

0 comments on commit 84ae150

Please sign in to comment.