1 # Copyright (c) 2019-2021 Arm Limited.
3 # SPDX-License-Identifier: MIT
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to
7 # deal in the Software without restriction, including without limitation the
8 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 # sell copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
12 # The above copyright notice and this permission notice shall be included in all
13 # copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 cmake_minimum_required(VERSION 2.8.11)
24 project(VkLayer_window_system_integration CXX)
26 find_package(PkgConfig REQUIRED)
27 pkg_check_modules(VULKAN_PKG_CONFIG vulkan)
29 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread")
31 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
34 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
36 if(NOT DEFINED VULKAN_CXX_INCLUDE)
37 set(VULKAN_CXX_INCLUDE ${VULKAN_PKG_CONFIG_INCLUDEDIR})
40 if(DEFINED VULKAN_CXX_INCLUDE)
41 message(STATUS "Using Vulkan include directories: ${VULKAN_CXX_INCLUDE}")
42 separate_arguments(VULKAN_CXX_INCLUDE)
44 message(FATAL_ERROR "Either vulkan.pc must be available or VULKAN_CXX_INCLUDE must be defined")
47 add_library(${PROJECT_NAME} SHARED
49 layer/private_data.cpp
51 layer/swapchain_api.cpp
52 util/timed_semaphore.cpp
53 util/custom_allocator.cpp
54 util/extension_list.cpp
55 wsi/swapchain_base.cpp
57 wsi/headless/surface_properties.cpp
58 wsi/headless/swapchain.cpp)
59 set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11)
60 target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR} ${VULKAN_CXX_INCLUDE})