Skip to content

Commit d06b19c

Browse files
committed
Remove Vulkan dependency when not needed
1 parent 07d0629 commit d06b19c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

3rdparty/imgui/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
find_package(Vulkan REQUIRED)
2-
31
set(IMGUI_SRC
42
imgui/imgui.cpp
53
imgui/imgui_draw.cpp
@@ -32,8 +30,11 @@ endif()
3230
add_library(imgui ${IMGUI_SRC})
3331
target_include_directories(imgui PUBLIC imgui)
3432

35-
target_link_libraries(imgui PUBLIC Vulkan::Vulkan)
36-
3733
if (USE_SDL)
3834
target_link_libraries(imgui PUBLIC SDL3::SDL3)
3935
endif()
36+
37+
if (USE_VULKAN)
38+
find_package(Vulkan REQUIRED)
39+
target_link_libraries(imgui PUBLIC Vulkan::Vulkan)
40+
endif()

src/GUI/Window/WindowSystem.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#include <chrono>
55
#include <thread>
66

7+
#ifdef USE_VULKAN
8+
#include <vulkan/vulkan.h>
9+
#endif
10+
711
#ifdef USE_SDL
812
#include <SDL3/SDL_vulkan.h>
913

@@ -17,8 +21,6 @@
1721
#include <backends/imgui_impl_win32.h>
1822
#endif
1923

20-
#include <backends/imgui_impl_vulkan.h>
21-
2224

2325
WindowSystem::WindowSystem(
2426
#ifdef USE_SDL
@@ -55,6 +57,7 @@ WindowSystem::~WindowSystem()
5557
}
5658

5759

60+
#ifdef USE_VULKAN
5861
void WindowSystem::getVkInstanceExtensions(std::vector<const char*>& extensions) const
5962
{
6063
#ifdef USE_SDL
@@ -69,6 +72,7 @@ void WindowSystem::getVkInstanceExtensions(std::vector<const char*>& extensions)
6972
extensions.push_back("VK_KHR_win32_surface");
7073
#endif
7174
}
75+
#endif
7276

7377

7478
void WindowSystem::collectEvents()

0 commit comments

Comments
 (0)