Skip to content

Commit

Permalink
CMake: vcpkg specific / do not select any default backend for vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Feb 2, 2024
1 parent d13e4e1 commit a888f9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hello_imgui_cmake/hello_imgui_build_lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ function(him_sanity_checks)
set(HELLOIMGUI_HAS_METAL OFF CACHE BOOL "" FORCE)
endif()

if (no_backend_option_chosen)
if (no_backend_option_chosen AND NOT HELLOIMGUI_USING_VCPKG_TOOLCHAIN)
# use SDL for emscripten and iOS
if (EMSCRIPTEN)
set(HELLOIMGUI_USE_SDL2 ON CACHE BOOL "" FORCE)
Expand All @@ -492,7 +492,7 @@ function(him_sanity_checks)
endif()

him_back_check_at_least_one_rendering_one_platform_backend(ok_backend)
if (NOT ok_backend)
if (NOT ok_backend AND NOT HELLOIMGUI_USING_VCPKG_TOOLCHAIN)
him_back_available_platform_backends(platform_backends)
him_back_available_rendering_backends(rendering_backends)
message(FATAL_ERROR "
Expand All @@ -509,6 +509,8 @@ function(_him_check_fetch_forbidden)
if(CMAKE_TOOLCHAIN_FILE)
if("${CMAKE_TOOLCHAIN_FILE}" MATCHES "vcpkg.cmake")
set(HELLOIMGUI_FETCH_FORBIDDEN ON CACHE INTERNAL "" FORCE)
set(HELLOIMGUI_DEFAULT_BACKEND_FORBIDDEN ON CACHE INTERNAL "" FORCE)
set(HELLOIMGUI_USING_VCPKG_TOOLCHAIN ON CACHE INTERNAL "" FORCE)
endif()
endif()
if(HELLOIMGUI_FETCH_FORBIDDEN)
Expand Down

0 comments on commit a888f9c

Please sign in to comment.