Skip to content

Commit fd70b0e

Browse files
committed
cmake: stub vulkan build
Still relies on OpenGL for everything, but add the required build-time toggle for a Vulkan build.
1 parent 36196cc commit fd70b0e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

CMakeLists.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ if(NOT DAEMON_EXTERNAL_APP)
117117
option(USE_MUMBLE "Build Daemon with mumblelink sumpport" ON)
118118
endif()
119119

120+
if (BUILD_CLIENT)
121+
option(USE_VULKAN "Use Vulkan rendering API instead of OpenGL." OFF)
122+
endif()
123+
120124
option(USE_SMP "Compile with support for running the renderer in a separate thread" ON)
121125
option(USE_BREAKPAD "Generate Daemon crash dumps (which require Breakpad tools to read)" OFF)
122126
endif()
@@ -562,6 +566,13 @@ if (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP)
562566
endif()
563567
endif()
564568

569+
if (USE_VULKAN)
570+
add_definitions("-DDAEMON_RENDERER_VULKAN=1")
571+
else()
572+
add_definitions("-DDAEMON_RENDERER_OPENGL=1")
573+
endif()
574+
575+
# TODO: Split OpenGL and Vulkan library configuration.
565576
# Look for OpenGL here before we potentially switch to looking for static libs.
566577
if (BUILD_CLIENT)
567578
if (LINUX OR FREEBSD)
@@ -937,9 +948,16 @@ if (BUILD_CLIENT)
937948
if (USE_SMP)
938949
list(APPEND Definitions USE_SMP)
939950
endif()
951+
952+
if (USE_VULKAN)
953+
set(CLIENT_EXECUTABLE_NAME daemon-vulkan)
954+
else()
955+
set(CLIENT_EXECUTABLE_NAME daemon)
956+
endif()
957+
940958
AddApplication(
941959
Target client
942-
ExecutableName daemon
960+
ExecutableName ${CLIENT_EXECUTABLE_NAME}
943961
ApplicationMain ${ENGINE_DIR}/client/ClientApplication.cpp
944962
Definitions ${Definitions}
945963
Flags ${WARNINGS}

src.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ set(COMMONTESTLIST
7777
${ENGINE_DIR}/qcommon/q_math_test.cpp
7878
)
7979

80+
# TODO: Split OpenGL and Vulkan list.
8081
set(RENDERERLIST
8182
${ENGINE_DIR}/renderer/DetectGLVendors.cpp
8283
${ENGINE_DIR}/renderer/DetectGLVendors.h

0 commit comments

Comments
 (0)