Vulkan-Utility-Libraries/CMakeLists.txt
Charles Giessen 2bd0e0d438 util: Fixup and add Dispatch Table header
Fixes the vk_layer_dispatch_table.h header file so that they can be used
in other projects. The contents of this header and
 vk_dispatch_table_helper.h have been moved into a new header
 vul_dispatch_table.h.

The structs VulDeviceDispatchTable and VulInstanceDispatchTable
struct contain function pointers for the device and instance, respectively.

The functions vul_init_device_dispatch_table and
vul_init_instance_dispatch_table fill out the aforementioned structs,
making the task of setting up the disptach table in a layer much simpler.
2023-08-23 15:07:01 -06:00

62 lines
1.9 KiB
CMake

# Copyright 2023 The Khronos Group Inc.
# Copyright 2023 Valve Corporation
# Copyright 2023 LunarG, Inc.
#
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.17.2)
project(VUL LANGUAGES CXX)
string(COMPARE EQUAL ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} VUL_IS_TOP_LEVEL) # Remove when min is 3.21
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # Remove when min is 3.26, see CMP0143
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
set(CMAKE_C_VISIBILITY_PRESET "hidden")
set(CMAKE_VISIBILITY_INLINES_HIDDEN "YES")
add_subdirectory(scripts)
find_package(VulkanHeaders CONFIG QUIET)
option(VUL_WERROR "Treat compiler warnings as errors")
if (VUL_WERROR)
add_compile_options("$<IF:$<CXX_COMPILER_ID:MSVC>,/WX,-Werror>")
if (MSVC)
add_link_options(/WX)
endif()
endif()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "(GNU|Clang)")
add_compile_options(
-Wall
-Wextra
)
endif()
add_library(VulkanUtilityHeaders INTERFACE)
add_library(Vulkan::UtilityHeaders ALIAS VulkanUtilityHeaders)
add_subdirectory(src)
add_subdirectory(include)
if (VUL_IS_TOP_LEVEL)
option(BUILD_TESTS "Build tests")
if (BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
include(GNUInstallDirs)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
set_target_properties(VulkanLayerSettings PROPERTIES EXPORT_NAME "LayerSettings")
set_target_properties(VulkanUtilityHeaders PROPERTIES EXPORT_NAME "UtilityHeaders")
install(TARGETS VulkanLayerSettings VulkanUtilityHeaders EXPORT VulkanUtilityLibrariesConfig INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT VulkanUtilityLibrariesConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VulkanUtilityLibraries NAMESPACE Vulkan::)
endif()