Lines Matching +full:vulkan +full:- +full:loader
2 # Copyright (c) 2014-2019 Valve Corporation
3 # Copyright (c) 2014-2019 LunarG, Inc.
9 # http://www.apache.org/licenses/LICENSE-2.0
18 # CMake project initialization ---------------------------------------------------------------------------------------------------
19 # This section contains pre-project() initialization, and ends with the project() command.
26 project(Vulkan-ValidationLayers)
28 # User-interface declarations ----------------------------------------------------------------------------------------------------
33 set(API_NAME "Vulkan" CACHE STRING "API name to use when building")
35 add_definitions(-DAPI_NAME="${API_NAME}")
41 if (TARGET Vulkan::Headers)
42 message(STATUS "Using Vulkan headers from Vulkan::Headers target")
43 get_target_property(VulkanHeaders_INCLUDE_DIRS Vulkan::Headers INTERFACE_INCLUDE_DIRECTORIES)
44 get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES)
49 add_library(Vulkan-Headers INTERFACE)
50 target_include_directories(Vulkan-Headers INTERFACE ${VulkanHeaders_INCLUDE_DIRS})
51 add_library(Vulkan::Headers ALIAS Vulkan-Headers)
105 # Platform-specific compiler switches
107 add_compile_options(-Wall
108 -Wextra
109 -Wno-unused-parameter
110 -Wno-missing-field-initializers
111 -fno-strict-aliasing
112 -fno-builtin-memcmp
113 -fvisibility=hidden)
118 add_compile_options(-Werror)
123 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
128 add_compile_options(-Wimplicit-fallthrough=0)
134 add_compile_options("/GR-")
158 set(GLSLANG_INSTALL_DIR "GLSLANG-NOTFOUND" CACHE PATH "Absolute path to a glslang install directory")
160 message(FATAL_ERROR "Must define location of glslang binaries -- see BUILD.md")
189 add_library(Loader STATIC IMPORTED)
245 # spirv-tools
246 if (NOT TARGET SPIRV-Tools)
248 CACHE PATH "User defined path to the SPIRV-Tools binaries for this project")
250 CACHE PATH "User defined path to the SPIRV-Tools-opt binaries for this project")
257 find_library(SPIRV_TOOLS_LIB NAMES SPIRV-Tools HINTS ${SPIRV_TOOLS_SEARCH_PATH})
258 find_library(SPIRV_TOOLS_OPT_LIB NAMES SPIRV-Tools-opt HINTS ${SPIRV_TOOLS_OPT_SEARCH_PATH})
261 add_library(SPIRV-Tools-opt STATIC IMPORTED)
262 add_library(SPIRV-Tools STATIC IMPORTED)
264 find_library(SPIRV_TOOLS_DLIB NAMES SPIRV-Toolsd HINTS ${SPIRV_TOOLS_DEBUG_SEARCH_PATH})
265 find_library(SPIRV_TOOLS_OPT_DLIB NAMES SPIRV-Tools-optd HINTS ${SPIRV_TOOLS_OPT_DEBUG_SEARCH_PATH})
267 set_target_properties(SPIRV-Tools
272 set_target_properties(SPIRV-Tools-opt
278 set(SPIRV_TOOLS_LIBRARIES SPIRV-Tools-opt SPIRV-Tools)
283 set(SPIRV_TOOLS_LIBRARIES SPIRV-Tools SPIRV-Tools-opt)
284 set(SPIRV_TOOLS_INCLUDE_DIR "${spirv-tools_SOURCE_DIR}/include" CACHE PATH "Path to spirv tools headers")
290 # Generate dependent helper files ------------------------------------------------------------------------------------------------
297 COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/lvl_genvk.py -registry ${VulkanRegistry_DIR}/vk.xml -scripts
306 # Add rules to generate XML-derived source files.
328 # VkLayer_utils library ----------------------------------------------------------------------------------------------------------
329 # For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search path that can't be easily
330 # modified to point it to the same directory that contains the layers. TODO: This should not be a library -- in future, include
339 target_link_libraries(VkLayer_utils PUBLIC Vulkan::Headers)
352 # uninstall target ---------------------------------------------------------------------------------------------------------------
358 add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
362 # Fetch header version from vulkan_core.h ----------------------------------------------------------------------------------------
363 file(STRINGS "${VulkanHeaders_INCLUDE_DIRS}/vulkan/vulkan_core.h" lines REGEX "^#define VK_HEADER_VERSION [0-9]+")
367 "[0-9]+"
374 # Add subprojects ----------------------------------------------------------------------------------------------------------------