Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ project(VulkanBootstrap
DESCRIPTION "A Vulkan utility library to ease the initialization steps in Vulkan"
VERSION ${VK_BOOTSTRAP_SOURCE_HEADER_VERSION})

# Occasionally Options DO NOT WORK since they don't get updated in the cached cmake files
# To fix this, you need to fully reload cmake by destroying the cache and reloading it

option(VK_BOOTSTRAP_DISABLE_WARNINGS "Disable warnings during compilation" OFF)
option(VK_BOOTSTRAP_WERROR "Enable warnings as errors during compilation" OFF)

option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap using Catch2 as well as build examples" ${PROJECT_IS_TOP_LEVEL})
option(VK_BOOTSTRAP_INSTALL "Enable installing of vk-bootstrap" ${PROJECT_IS_TOP_LEVEL})

option(VK_BOOTSTRAP_FORCE_FETCH_CONTENT "Forces Vulkan-Headers to be acquired using Fetch Content")

option(VK_BOOTSTRAP_SHARED "Compile Vk Bootstrap as a Shared Library" OFF)

set(VK_BOOTSTRAP_VULKAN_HEADER_DIR "" CACHE FILEPATH "Specify the location of the Vulkan-Headers include directory.")
mark_as_advanced(VK_BOOTSTRAP_VULKAN_HEADER_DIR)

Expand Down Expand Up @@ -87,9 +93,14 @@ if(NOT VK_BOOTSTRAP_DISABLE_WARNINGS)
endif()
endif()

add_library(vk-bootstrap STATIC src/VkBootstrap.h src/VkBootstrap.cpp src/VkBootstrapDispatch.h src/VkBootstrapFeatureChain.h src/VkBootstrapFeatureChain.inl)
add_library(vk-bootstrap src/VkBootstrap.h src/VkBootstrap.cpp src/VkBootstrapDispatch.h src/VkBootstrapFeatureChain.h src/VkBootstrapFeatureChain.inl)
add_library(vk-bootstrap::vk-bootstrap ALIAS vk-bootstrap)

# Tell Code that we are a shared library
if (BUILD_SHARED_LIBS)
target_compile_definitions(vk-bootstrap PUBLIC VK_SHARED)
endif()

target_include_directories(vk-bootstrap PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>)
Expand Down
2 changes: 1 addition & 1 deletion src/VkBootstrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class VulkanFunctions {
}
};

static VulkanFunctions& vulkan_functions() {
VulkanFunctions& vulkan_functions() {
static VulkanFunctions v;
return v;
}
Expand Down
Loading