Skip to content

Commit

Permalink
Add CMake preset build_all_backends
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Feb 2, 2024
1 parent e73700d commit 26882b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
"HELLOIMGUI_HAS_OPENGL3": "ON"
}
},
{
"name": "build_all_backends",
"description": "Build with all platform and renderer backends. You need to create a build directory and run from it",
"cacheVariables": {
"HELLOIMGUI_USE_SDL2": "ON",
"HELLOIMGUI_USE_GLFW3": "ON",
"HELLOIMGUI_HAS_OPENGL3": "ON",
"HELLOIMGUI_HAS_METAL": "ON",
"HELLOIMGUI_HAS_VULKAN": "ON",
"HELLOIMGUI_HAS_DIRECTX11": "ON",
"HELLOIMGUI_HAS_DIRECTX12": "ON"
}
},
{
"name": "build_vcpkg_default",
"description": "Build with vcpkg default settings (opengl3 + sdl and glfw). You need to create a build directory and run from it",
Expand Down
8 changes: 8 additions & 0 deletions hello_imgui_cmake/hello_imgui_build_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,14 @@ endfunction()
function(him_sanity_checks)
him_back_check_if_no_backend_option_chosen(no_backend_option_chosen)

if (NOT WIN32)
set(HELLOIMGUI_HAS_DIRECTX11 OFF CACHE BOOL "" FORCE)
set(HELLOIMGUI_HAS_DIRECTX12 OFF CACHE BOOL "" FORCE)
endif()
if (NOT APPLE)
set(HELLOIMGUI_HAS_METAL OFF CACHE BOOL "" FORCE)
endif()

if (no_backend_option_chosen)
# use SDL for emscripten and iOS
if (EMSCRIPTEN)
Expand Down

0 comments on commit 26882b0

Please sign in to comment.