mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-10 02:41:47 +00:00
37 lines
1.2 KiB
CMake
37 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
|
|
project(VulkanBootstrap)
|
|
|
|
find_package(Vulkan REQUIRED)
|
|
|
|
add_library(vk-bootstrap src/VkBootstrap.h src/VkBootstrap.cpp)
|
|
add_library(vk-bootstrap::vk-bootstrap ALIAS vk-bootstrap)
|
|
|
|
add_library(vk-bootstrap-compiler-warnings INTERFACE)
|
|
target_compile_options(vk-bootstrap-compiler-warnings
|
|
INTERFACE
|
|
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>,$<AND:$<CXX_COMPILER_ID:Clang>,$<NOT:$<STREQUAL:"x${CMAKE_CXX_SIMULATE_ID}","xMSVC">>>>:
|
|
-Wall
|
|
-Wextra
|
|
-pedantic-errors
|
|
-Wconversion
|
|
-Wsign-conversion>
|
|
$<$<OR:$<CXX_COMPILER_ID:MSVC>,$<AND:$<CXX_COMPILER_ID:Clang>,$<STREQUAL:"x${CMAKE_CXX_SIMULATE_ID}","xMSVC">>>:
|
|
/WX
|
|
/W4>
|
|
)
|
|
|
|
target_include_directories(vk-bootstrap PUBLIC src)
|
|
target_include_directories(vk-bootstrap PUBLIC ${Vulkan_INCLUDE_DIR})
|
|
target_link_libraries(vk-bootstrap
|
|
PUBLIC ${Vulkan_LIBRARY}
|
|
PRIVATE
|
|
vk-bootstrap-compiler-warnings)
|
|
|
|
option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF)
|
|
|
|
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST)
|
|
add_subdirectory(ext)
|
|
add_subdirectory(tests)
|
|
add_subdirectory(example)
|
|
endif ()
|