Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #7395 from mazes-80/11374
Cmake option to enable/disable vulkan video backend
  • Loading branch information
leoetlino committed Oct 23, 2020
2 parents 908d6f8 + f375ee7 commit 271676a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Expand Up @@ -35,6 +35,7 @@ option(ENABLE_ALSA "Enables ALSA sound backend" ON)
option(ENABLE_PULSEAUDIO "Enables PulseAudio sound backend" ON)
option(ENABLE_LLVM "Enables LLVM support, for disassembly" ON)
option(ENABLE_TESTS "Enables building the unit tests" ON)
option(ENABLE_VULKAN "Enables vulkan video backend" ON)
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current game on Discord" ON)

# Maintainers: if you consider blanket disabling this for your users, please
Expand Down Expand Up @@ -543,6 +544,7 @@ if (_M_X86)
add_subdirectory(Externals/Bochs_disasm)
endif()
add_subdirectory(Externals/cpp-optparse)

find_package(fmt 6.0)
if(fmt_FOUND)
message(STATUS "Using shared fmt ${fmt_VERSION}")
Expand All @@ -551,8 +553,12 @@ else()
message(STATUS "Using static fmt from Externals")
add_subdirectory(Externals/fmt EXCLUDE_FROM_ALL)
endif()
add_subdirectory(Externals/glslang)
add_subdirectory(Externals/imgui)
add_subdirectory(Externals/glslang)

if(ENABLE_VULKAN)
add_definitions(-DUSE_VULKAN)
endif()

find_package(pugixml)
if(NOT pugixml_FOUND)
Expand Down
5 changes: 4 additions & 1 deletion Source/Core/Core/CMakeLists.txt
Expand Up @@ -563,7 +563,6 @@ PUBLIC
videonull
videoogl
videosoftware
videovulkan

PRIVATE
fmt::fmt
Expand Down Expand Up @@ -601,6 +600,10 @@ if(LIBUSB_FOUND)
)
endif()

if(ENABLE_VULKAN)
target_link_libraries(core PUBLIC videovulkan)
endif()

if(WIN32)
target_sources(core PRIVATE
HW/EXI/BBA/TAP_Win32.cpp
Expand Down
4 changes: 3 additions & 1 deletion Source/Core/VideoBackends/CMakeLists.txt
@@ -1,11 +1,13 @@
add_subdirectory(OGL)
add_subdirectory(Null)
add_subdirectory(Software)
add_subdirectory(Vulkan)

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_subdirectory(D3DCommon)
add_subdirectory(D3D)
add_subdirectory(D3D12)
endif()

if(ENABLE_VULKAN)
add_subdirectory(Vulkan)
endif()
2 changes: 2 additions & 0 deletions Source/Core/VideoCommon/VideoBackendBase.cpp
Expand Up @@ -225,7 +225,9 @@ const std::vector<std::unique_ptr<VideoBackendBase>>& VideoBackendBase::GetAvail
backends.push_back(std::make_unique<DX11::VideoBackend>());
backends.push_back(std::make_unique<DX12::VideoBackend>());
#endif
#ifdef USE_VULKAN
backends.push_back(std::make_unique<Vulkan::VideoBackend>());
#endif
#ifdef HAS_OPENGL
backends.push_back(std::make_unique<SW::VideoSoftware>());
#endif
Expand Down

0 comments on commit 271676a

Please sign in to comment.