Files
fennec/cmake/vulkan.cmake
Medusa Slockbower cf909624df - More Documentation
- Vulkan Configuration Implementations
 - Fixed build errors on GCC and Clang
2026-07-18 23:48:00 -04:00

57 lines
2.3 KiB
CMake

# ======================================================================================================================
# fennec, a free and open source game engine
# Copyright © 2025 - 2026 Medusa Slockbower
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# ======================================================================================================================
find_package(Vulkan COMPONENTS glslang)
# MoltenVK for Apple Products
if(FENNEC_GRAPHICS_WANT_MOLTENVK)
find_package(Vulkan COMPONENTS MoltenVK)
endif()
# Headers and Loaders
if( TARGET Vulkan::Headers # Base Headers and Meta-Loader
AND TARGET Vulkan::glslang # GLSL Compilation
AND (NOT FENNEC_GRAPHICS_WANT_MOLTENVK OR TARGET Vulkan::MoltenVK)
)
# Link & Define Vulkan Libraries
fennec_add_link_libraries(Vulkan::glslang)
fennec_add_definitions(FENNEC_GRAPHICS_VULKAN=1)
# Cmake Definition for Vulkan detection
set(FENNEC_FOUND_VULKAN TRUE)
# Add Vulkan Sources
fennec_add_sources(
include/fennec/renderers/vulkan/lib/forward.h
include/fennec/renderers/vulkan/lib/app_info.h
include/fennec/renderers/vulkan/lib/debug.h
include/fennec/renderers/vulkan/lib/enum.h
include/fennec/renderers/vulkan/lib/instance.h
include/fennec/renderers/vulkan/lib/physical_device.h
include/fennec/renderers/vulkan/lib/surface.h
include/fennec/platform/vulkan/volk/volk.h source/platform/vulkan/volk/volk.c
include/fennec/renderers/vulkan/vkcontext.h source/renderers/vulkan/vkcontext.cpp
include/fennec/renderers/vulkan/vksurface.h source/renderers/vulkan/vksurface.cpp
)
else()
message(WARNING "No Suitable Vulkan implementation found.")
endif()