mirror of
https://github.com/KhronosGroup/Vulkan-Hpp
synced 2024-11-21 20:00:11 +00:00
Cleanup up on CMakeLists.txt (#1564)
This commit is contained in:
parent
20cb37e39f
commit
e1d6ec8abf
546
CMakeLists.txt
546
CMakeLists.txt
@ -26,271 +26,327 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
function( vulkan_hpp__setup_platform )
|
||||
set( options )
|
||||
set( oneValueArgs NAME )
|
||||
set( multiValueArgs )
|
||||
cmake_parse_arguments( TARGET "{options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
if( WIN32 )
|
||||
target_compile_definitions( ${TARGET_NAME} PUBLIC NOMINMAX VK_USE_PLATFORM_WIN32_KHR )
|
||||
elseif( APPLE )
|
||||
target_compile_definitions( ${TARGET_NAME} PUBLIC VK_USE_PLATFORM_MACOS_MVK )
|
||||
elseif( UNIX )
|
||||
target_compile_definitions( ${TARGET_NAME} PUBLIC VK_USE_PLATFORM_XCB_KHR )
|
||||
else()
|
||||
message( FATAL_ERROR, "Vulkan-Hpp: unhandled platform!" )
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
project(VulkanHppGenerator LANGUAGES CXX)
|
||||
function( vulkan_hpp__setup_project )
|
||||
set( options )
|
||||
set( oneValueArgs NAME )
|
||||
set( multiValueArgs )
|
||||
cmake_parse_arguments( TARGET "{options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
project( ${TARGET_NAME} LANGUAGES CXX )
|
||||
endfunction()
|
||||
|
||||
function( vulkan_hpp__setup_library )
|
||||
set( options SHARED )
|
||||
set( oneValueArgs NAME )
|
||||
set( multiValueArgs HEADERS SOURCES )
|
||||
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
vulkan_hpp__setup_project( NAME ${TARGET_NAME} )
|
||||
|
||||
if( "${TARGET_SOURCES}" STREQUAL "" )
|
||||
add_library( ${TARGET_NAME} INTERFACE ${TARGET_HEADERS} )
|
||||
else()
|
||||
if( ${TARGET_SHARED} )
|
||||
add_library( ${TARGET_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS} )
|
||||
else()
|
||||
add_library( ${TARGET_NAME} ${TARGET_SOURCES} ${TARGET_HEADERS} )
|
||||
endif()
|
||||
vulkan_hpp__setup_platform( NAME ${TARGET_NAME} )
|
||||
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON )
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function( vulkan_hpp__setup_sample )
|
||||
set( options )
|
||||
set( oneValueArgs FOLDER NAME PCH_REUSE )
|
||||
set( multiValueArgs HEADERS INCLUDE_DIRS LIBS PCH SOURCES )
|
||||
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
vulkan_hpp__setup_project( NAME ${TARGET_NAME} )
|
||||
|
||||
add_executable( ${TARGET_NAME} ${TARGET_HEADERS} ${TARGET_SOURCES} )
|
||||
|
||||
vulkan_hpp__setup_platform( NAME ${TARGET_NAME} )
|
||||
|
||||
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON )
|
||||
|
||||
if( TARGET_FOLDER )
|
||||
set_target_properties( ${TARGET_NAME} PROPERTIES FOLDER "${TARGET_FOLDER}" )
|
||||
endif()
|
||||
if( TARGET_INCLUDE_DIRS )
|
||||
target_include_directories( ${TARGET_NAME} PUBLIC ${TARGET_INCLUDE_DIRS} )
|
||||
endif()
|
||||
if( TARGET_LIBS )
|
||||
target_link_libraries( ${TARGET_NAME} PRIVATE "${TARGET_LIBS}" )
|
||||
endif()
|
||||
if( VULKAN_HPP_PRECOMPILE )
|
||||
if( TARGET_PCH_REUSE )
|
||||
target_precompile_headers( ${TARGET_NAME} REUSE_FROM "${TARGET_PCH_REUSE}" )
|
||||
elseif( TARGET_PCH )
|
||||
target_precompile_headers( ${TARGET_NAME} PRIVATE "${TARGET_PCH}" )
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function( vulkan_hpp__setup_sample_static )
|
||||
set( options )
|
||||
set( oneValueArgs NAME )
|
||||
set( multiValueArgs )
|
||||
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
if( NOT SAMPLES_BUILD_ONLY_DYNAMIC )
|
||||
if( NOT TARGET_NAME )
|
||||
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_sample_static" )
|
||||
endif()
|
||||
|
||||
find_package( Vulkan REQUIRED )
|
||||
|
||||
vulkan_hpp__setup_sample(
|
||||
NAME ${TARGET_NAME}
|
||||
FOLDER Samples
|
||||
PCH <vulkan/vulkan.hpp>
|
||||
SOURCES ${TARGET_NAME}.cpp
|
||||
LIBS ${Vulkan_LIBRARIES} )
|
||||
|
||||
target_compile_definitions( 01_InitInstance PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0 )
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function( vulkan_hpp__setup_sample_dynamic )
|
||||
set( options )
|
||||
set( oneValueArgs NAME )
|
||||
set( multiValueArgs HEADERS INCLUDE_DIRS SOURCES )
|
||||
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
if( NOT TARGET_NAME )
|
||||
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_sample_dynamic" )
|
||||
endif()
|
||||
if( NOT TARGET_SOURCES )
|
||||
set( TARGET_SOURCES ${TARGET_NAME}.cpp )
|
||||
endif()
|
||||
|
||||
vulkan_hpp__setup_sample(
|
||||
NAME ${TARGET_NAME}
|
||||
FOLDER Samples
|
||||
PCH_REUSE utils
|
||||
INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}
|
||||
HEADERS ${TARGET_HEADERS}
|
||||
SOURCES ${TARGET_SOURCES}
|
||||
LIBS utils )
|
||||
endfunction()
|
||||
|
||||
function( vulkan_hpp__setup_sample_raii )
|
||||
set( options )
|
||||
set( oneValueArgs NAME )
|
||||
set( multiValueArgs HEADERS INCLUDE_DIRS SOURCES )
|
||||
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
if( NOT TARGET_NAME )
|
||||
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_sample_raii" )
|
||||
endif()
|
||||
if( NOT TARGET_SOURCES )
|
||||
set( TARGET_SOURCES ${TARGET_NAME}.cpp )
|
||||
endif()
|
||||
|
||||
vulkan_hpp__setup_sample(
|
||||
NAME RAII_${TARGET_NAME}
|
||||
FOLDER RAII_Samples
|
||||
PCH_REUSE utils
|
||||
INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}
|
||||
HEADERS ${TARGET_HEADERS}
|
||||
SOURCES ${TARGET_SOURCES}
|
||||
LIBS utils )
|
||||
endfunction()
|
||||
|
||||
function( vulkan_hpp__setup_test )
|
||||
set( options )
|
||||
set( oneValueArgs CXX_STANDARD NAME )
|
||||
set( multiValueArgs )
|
||||
cmake_parse_arguments( TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
if( NOT TARGET_NAME )
|
||||
message( FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_test" )
|
||||
endif()
|
||||
if( NOT TARGET_CXX_STANDARD )
|
||||
set( TARGET_CXX_STANDARD 11 )
|
||||
endif()
|
||||
|
||||
vulkan_hpp__setup_project( NAME ${TARGET_NAME} )
|
||||
|
||||
add_executable( ${TARGET_NAME} ${TARGET_NAME}.cpp )
|
||||
|
||||
vulkan_hpp__setup_platform( NAME ${TARGET_NAME} )
|
||||
|
||||
set_target_properties( ${TARGET_NAME} PROPERTIES CXX_STANDARD ${TARGET_CXX_STANDARD} CXX_STANDARD_REQUIRED ON )
|
||||
endfunction()
|
||||
|
||||
set_property( GLOBAL PROPERTY USE_FOLDERS ON )
|
||||
|
||||
find_program(CLANG_FORMAT_EXECUTABLE NAMES clang-format)
|
||||
|
||||
if(CLANG_FORMAT_EXECUTABLE)
|
||||
# get the clang-format version string
|
||||
execute_process(COMMAND ${CLANG_FORMAT_EXECUTABLE} "--version" OUTPUT_VARIABLE clangFormatVersion)
|
||||
# filter out the actual version
|
||||
string(REGEX MATCH [0123456789.]+ clangFormatVersion "${clangFormatVersion}")
|
||||
# we need at least version 7.0.0 !
|
||||
if (clangFormatVersion VERSION_LESS 7.0.0)
|
||||
message(WARNING " Found too old clang-format version <" ${clangFormatVersion} ">, we need version 7 and up to nicely format vulkan.hpp and vulkan_raii.hpp")
|
||||
else ()
|
||||
message(STATUS " Found clang-format version <" ${clangFormatVersion} ">.")
|
||||
add_definitions(-DCLANG_FORMAT_EXECUTABLE="${CLANG_FORMAT_EXECUTABLE}")
|
||||
if (clangFormatVersion VERSION_LESS 11.0.0)
|
||||
message(STATUS " Using .clang-format version 7." )
|
||||
file(READ ".clang-format_7" clangFormat)
|
||||
elseif ( clangFormatVersion VERSION_LESS 12.0.0)
|
||||
message(STATUS " Using .clang-format version 11." )
|
||||
file(READ ".clang-format_11" clangFormat)
|
||||
elseif ( clangFormatVersion VERSION_LESS 13.0.0)
|
||||
message(STATUS " Using .clang-format version 12." )
|
||||
file(READ ".clang-format_12" clangFormat)
|
||||
elseif ( clangFormatVersion VERSION_LESS 14.0.0)
|
||||
message(STATUS " Using .clang-format version 13." )
|
||||
file(READ ".clang-format_13" clangFormat)
|
||||
elseif ( clangFormatVersion VERSION_LESS 15.0.0)
|
||||
message(STATUS " Using .clang-format version 14." )
|
||||
file(READ ".clang-format_14" clangFormat)
|
||||
else ()
|
||||
message(STATUS " Using .clang-format version 15." )
|
||||
file(READ ".clang-format_15" clangFormat)
|
||||
endif ()
|
||||
file(WRITE ".clang-format" ${clangFormat})
|
||||
endif()
|
||||
if( CLANG_FORMAT_EXECUTABLE )
|
||||
# get the clang-format version string
|
||||
execute_process( COMMAND ${CLANG_FORMAT_EXECUTABLE} "--version" OUTPUT_VARIABLE clangFormatVersion )
|
||||
# filter out the actual version
|
||||
string( REGEX MATCH [0123456789.]+ clangFormatVersion "${clangFormatVersion}" )
|
||||
# we need at least version 7.0.0 !
|
||||
if( clangFormatVersion VERSION_LESS 7.0.0 )
|
||||
message( WARNING " Found too old clang-format version <" ${clangFormatVersion} ">, we need version 7 and up to nicely format vulkan.hpp and vulkan_raii.hpp" )
|
||||
else()
|
||||
message( STATUS " Found clang-format version <" ${clangFormatVersion} ">." )
|
||||
add_definitions( -DCLANG_FORMAT_EXECUTABLE="${CLANG_FORMAT_EXECUTABLE}" )
|
||||
if( clangFormatVersion VERSION_LESS 11.0.0 )
|
||||
message( STATUS " Using .clang-format version 7." )
|
||||
file( READ ".clang-format_7" clangFormat )
|
||||
elseif( clangFormatVersion VERSION_LESS 12.0.0 )
|
||||
message( STATUS " Using .clang-format version 11." )
|
||||
file( READ ".clang-format_11" clangFormat )
|
||||
elseif( clangFormatVersion VERSION_LESS 13.0.0 )
|
||||
message( STATUS " Using .clang-format version 12." )
|
||||
file( READ ".clang-format_12" clangFormat )
|
||||
elseif( clangFormatVersion VERSION_LESS 14.0.0 )
|
||||
message( STATUS " Using .clang-format version 13." )
|
||||
file( READ ".clang-format_13" clangFormat )
|
||||
elseif( clangFormatVersion VERSION_LESS 15.0.0 )
|
||||
message( STATUS " Using .clang-format version 14." )
|
||||
file( READ ".clang-format_14" clangFormat )
|
||||
else()
|
||||
message(STATUS " Using .clang-format version 15." )
|
||||
file( READ ".clang-format_15" clangFormat )
|
||||
endif()
|
||||
file( WRITE ".clang-format" ${clangFormat} )
|
||||
endif()
|
||||
else()
|
||||
message(WARNING " Could not find clang-format. Generated vulkan.hpp and vulkan_raii.hpp will not be nicely formatted.")
|
||||
message( WARNING " Could not find clang-format. Generated vulkan.hpp and vulkan_raii.hpp will not be nicely formatted." )
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
if( NOT DEFINED VulkanRegistry_DIR )
|
||||
if( DEFINED VULKAN_HPP_VULKAN_HEADERS_SRC_DIR )
|
||||
set( VulkanRegistry_DIR "${VULKAN_HPP_VULKAN_HEADERS_SRC_DIR}/registry" )
|
||||
else()
|
||||
set( VulkanRegistry_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/registry" )
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
file( TO_NATIVE_PATH ${VulkanRegistry_DIR}/vk.xml vk_spec )
|
||||
string( REPLACE "\\" "\\\\" vk_spec ${vk_spec} )
|
||||
|
||||
message(STATUS "CMAKE_CXX_STANDARD = <${CMAKE_CXX_STANDARD}>")
|
||||
project( VulkanHppGenerator LANGUAGES CXX )
|
||||
|
||||
if (NOT DEFINED VulkanRegistry_DIR)
|
||||
if (DEFINED VULKAN_HPP_VULKAN_HEADERS_SRC_DIR)
|
||||
set(VulkanRegistry_DIR "${VULKAN_HPP_VULKAN_HEADERS_SRC_DIR}/registry")
|
||||
else()
|
||||
set(VulkanRegistry_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/registry")
|
||||
endif()
|
||||
if( NOT DEFINED VulkanHeaders_INCLUDE_DIR )
|
||||
if( DEFINED VULKAN_HPP_PATH )
|
||||
set( VulkanHeaders_INCLUDE_DIR ${VULKAN_HPP_PATH} )
|
||||
else()
|
||||
set( VulkanHeaders_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||
endif()
|
||||
endif()
|
||||
file(TO_NATIVE_PATH ${VulkanRegistry_DIR}/vk.xml vk_spec)
|
||||
string(REPLACE "\\" "\\\\" vk_spec ${vk_spec})
|
||||
add_definitions(-DVK_SPEC="${vk_spec}")
|
||||
include_directories( ${VulkanHeaders_INCLUDE_DIR} )
|
||||
|
||||
if (NOT DEFINED VulkanHeaders_INCLUDE_DIR)
|
||||
if (DEFINED VULKAN_HPP_PATH)
|
||||
set(VulkanHeaders_INCLUDE_DIR ${VULKAN_HPP_PATH})
|
||||
else()
|
||||
set(VulkanHeaders_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
endif()
|
||||
set( HEADERS VulkanHppGenerator.hpp )
|
||||
|
||||
set( SOURCES VulkanHppGenerator.cpp )
|
||||
|
||||
if( NOT DEFINED VULKAN_HPP_TINYXML2_SRC_DIR )
|
||||
set( VULKAN_HPP_TINYXML2_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2" )
|
||||
endif()
|
||||
include_directories(${VulkanHeaders_INCLUDE_DIR})
|
||||
|
||||
set(HEADERS
|
||||
VulkanHppGenerator.hpp
|
||||
set( TINYXML2_SOURCES ${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.cpp )
|
||||
|
||||
set( TINYXML2_HEADERS ${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.h )
|
||||
|
||||
source_group( headers FILES ${HEADERS} )
|
||||
source_group( sources FILES ${SOURCES} )
|
||||
|
||||
source_group( TinyXML2\\headers FILES ${TINYXML2_HEADERS} )
|
||||
source_group( TinyXML2\\sources FILES ${TINYXML2_SOURCES} )
|
||||
|
||||
add_executable( VulkanHppGenerator
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
${TINYXML2_SOURCES}
|
||||
${TINYXML2_HEADERS}
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
VulkanHppGenerator.cpp
|
||||
target_compile_definitions( ${PROJECT_NAME} PUBLIC BASE_PATH="${CMAKE_SOURCE_DIR}" VK_SPEC="${vk_spec}" )
|
||||
|
||||
set( VK_GENERATED_VULKAN_HEADERS
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_enums.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_format_traits.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_funcs.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_handles.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_hash.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_raii.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_static_assertions.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_structs.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_to_string.hpp
|
||||
)
|
||||
|
||||
if (NOT DEFINED VULKAN_HPP_TINYXML2_SRC_DIR)
|
||||
set(VULKAN_HPP_TINYXML2_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2")
|
||||
file( TO_NATIVE_PATH ${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan.hpp vulkan_hpp )
|
||||
string( REPLACE "\\" "\\\\" vulkan_hpp ${vulkan_hpp} )
|
||||
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON )
|
||||
|
||||
if( MSVC )
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX )
|
||||
if( MSVC_VER GREATER_EQUAL 1910 )
|
||||
target_compile_options( ${PROJECT_NAME} PRIVATE /permissive- )
|
||||
endif()
|
||||
else( MSVC )
|
||||
target_compile_options( ${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic -Werror )
|
||||
endif( MSVC )
|
||||
|
||||
target_include_directories( ${PROJECT_NAME} PRIVATE ${VULKAN_HPP_TINYXML2_SRC_DIR} )
|
||||
|
||||
option( VULKAN_HPP_RUN_GENERATOR "Run the HPP generator" OFF )
|
||||
if( VULKAN_HPP_RUN_GENERATOR )
|
||||
add_custom_command(
|
||||
COMMAND ${PROJECT_NAME}
|
||||
COMMAND ${PROJECT_NAME} -api vulkansc
|
||||
OUTPUT "${vulkan_hpp}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
COMMENT "run ${PROJECT_NAME}"
|
||||
DEPENDS ${PROJECT_NAME} "${vk_spec}" )
|
||||
|
||||
add_custom_target( build_vulkan_hpp ALL DEPENDS "${vulkan_hpp}" "${vk_spec}" )
|
||||
endif()
|
||||
|
||||
set(TINYXML2_SOURCES
|
||||
${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.cpp
|
||||
)
|
||||
option( VULKAN_HPP_PRECOMPILE "Precompile vulkan.hpp and vulkan_raii.hpp for sample builds" ON )
|
||||
|
||||
set(TINYXML2_HEADERS
|
||||
${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.h
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
source_group(TinyXML2\\headers FILES ${TINYXML2_HEADERS})
|
||||
source_group(TinyXML2\\sources FILES ${TINYXML2_SOURCES})
|
||||
|
||||
add_executable(VulkanHppGenerator
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
${TINYXML2_SOURCES}
|
||||
${TINYXML2_HEADERS}
|
||||
)
|
||||
|
||||
set(VK_GENERATED_VULKAN_HEADERS
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_enums.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_format_traits.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_funcs.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_handles.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_hash.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_raii.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_static_assertions.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_structs.hpp
|
||||
${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan_to_string.hpp
|
||||
)
|
||||
|
||||
file(TO_NATIVE_PATH ${VulkanHeaders_INCLUDE_DIR}/vulkan/vulkan.hpp vulkan_hpp)
|
||||
string(REPLACE "\\" "\\\\" vulkan_hpp ${vulkan_hpp})
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC -DBASE_PATH="${CMAKE_SOURCE_DIR}")
|
||||
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX)
|
||||
if (MSVC_VER GREATER_EQUAL 1910)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE /permissive-)
|
||||
endif()
|
||||
else(MSVC)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic -Werror)
|
||||
endif(MSVC)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${VULKAN_HPP_TINYXML2_SRC_DIR})
|
||||
|
||||
option (VULKAN_HPP_RUN_GENERATOR "Run the HPP generator" OFF)
|
||||
if (VULKAN_HPP_RUN_GENERATOR)
|
||||
add_custom_command(
|
||||
COMMAND ${PROJECT_NAME}
|
||||
COMMAND ${PROJECT_NAME} -api vulkansc
|
||||
OUTPUT "${vulkan_hpp}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
COMMENT "run ${PROJECT_NAME}"
|
||||
DEPENDS ${PROJECT_NAME} "${vk_spec}")
|
||||
|
||||
add_custom_target(build_vulkan_hpp ALL
|
||||
DEPENDS "${vulkan_hpp}" "${vk_spec}")
|
||||
option( SAMPLES_BUILD "Build samples" OFF )
|
||||
if( SAMPLES_BUILD )
|
||||
# external libraries
|
||||
add_subdirectory( glm )
|
||||
set( GLFW_BUILD_EXAMPLES OFF )
|
||||
set( GLFW_BUILD_TESTS OFF )
|
||||
add_subdirectory( glfw )
|
||||
add_subdirectory( glslang )
|
||||
# samples
|
||||
add_subdirectory( samples )
|
||||
add_subdirectory( RAII_Samples )
|
||||
endif()
|
||||
|
||||
option (VULKAN_HPP_PRECOMPILE "Precompile vulkan.hpp and vulkan_raii.hpp for sample builds" ON)
|
||||
|
||||
function(vulkan_hpp__setup_sample)
|
||||
set(options)
|
||||
set(oneValueArgs FOLDER NAME PCH_REUSE)
|
||||
set(multiValueArgs HEADERS INCLUDE_DIRS LIBS PCH SOURCES)
|
||||
|
||||
cmake_parse_arguments(TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(${TARGET_NAME} STREQUAL "")
|
||||
message(FATAL_ERROR "NAME must be defined in vulkan_hpp__setup_sample")
|
||||
endif()
|
||||
|
||||
project(${TARGET_NAME} LANGUAGES CXX)
|
||||
|
||||
add_executable(${TARGET_NAME} ${TARGET_HEADERS} ${TARGET_SOURCES})
|
||||
|
||||
if (TARGET_INCLUDE_DIRS)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${TARGET_INCLUDE_DIRS})
|
||||
endif()
|
||||
if (TARGET_FOLDER)
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "${TARGET_FOLDER}")
|
||||
endif()
|
||||
if (VULKAN_HPP_PRECOMPILE)
|
||||
if (TARGET_PCH_REUSE)
|
||||
target_precompile_headers(${TARGET_NAME} REUSE_FROM "${TARGET_PCH_REUSE}")
|
||||
elseif (TARGET_PCH)
|
||||
target_precompile_headers(${TARGET_NAME} PRIVATE "${TARGET_PCH}")
|
||||
endif()
|
||||
endif()
|
||||
if (TARGET_LIBS)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE "${TARGET_LIBS}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(vulkan_hpp__setup_sample_static)
|
||||
set(options)
|
||||
set(oneValueArgs NAME)
|
||||
set(multiValueArgs)
|
||||
|
||||
cmake_parse_arguments(TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if(NOT SAMPLES_BUILD_ONLY_DYNAMIC)
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
vulkan_hpp__setup_sample(
|
||||
NAME ${TARGET_NAME}
|
||||
FOLDER Samples
|
||||
PCH <vulkan/vulkan.hpp>
|
||||
SOURCES ${TARGET_NAME}.cpp
|
||||
LIBS ${Vulkan_LIBRARIES})
|
||||
|
||||
target_compile_definitions(01_InitInstance PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=0)
|
||||
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(vulkan_hpp__setup_sample_dynamic)
|
||||
set(options)
|
||||
set(oneValueArgs NAME)
|
||||
set(multiValueArgs HEADERS INCLUDE_DIRS SOURCES)
|
||||
|
||||
cmake_parse_arguments(TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (NOT TARGET_SOURCES)
|
||||
set(TARGET_SOURCES ${TARGET_NAME}.cpp)
|
||||
endif()
|
||||
|
||||
vulkan_hpp__setup_sample(
|
||||
NAME ${TARGET_NAME}
|
||||
FOLDER Samples
|
||||
PCH_REUSE utils
|
||||
INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}
|
||||
HEADERS ${TARGET_HEADERS}
|
||||
SOURCES ${TARGET_SOURCES}
|
||||
LIBS utils)
|
||||
endfunction()
|
||||
|
||||
function(vulkan_hpp__setup_sample_raii)
|
||||
set(options)
|
||||
set(oneValueArgs NAME)
|
||||
set(multiValueArgs HEADERS INCLUDE_DIRS SOURCES)
|
||||
|
||||
cmake_parse_arguments(TARGET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (NOT TARGET_SOURCES)
|
||||
set(TARGET_SOURCES ${TARGET_NAME}.cpp)
|
||||
endif()
|
||||
|
||||
vulkan_hpp__setup_sample(
|
||||
NAME RAII_${TARGET_NAME}
|
||||
FOLDER RAII_Samples
|
||||
PCH_REUSE utils
|
||||
INCLUDE_DIRS ${TARGET_INCLUDE_DIRS}
|
||||
HEADERS ${TARGET_HEADERS}
|
||||
SOURCES ${TARGET_SOURCES}
|
||||
LIBS utils)
|
||||
endfunction()
|
||||
|
||||
option (SAMPLES_BUILD "Build samples" OFF)
|
||||
if (SAMPLES_BUILD)
|
||||
# external libraries
|
||||
add_subdirectory(glm)
|
||||
set(GLFW_BUILD_EXAMPLES OFF)
|
||||
set(GLFW_BUILD_TESTS OFF)
|
||||
add_subdirectory(glfw)
|
||||
add_subdirectory(glslang)
|
||||
# samples
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(RAII_Samples)
|
||||
endif ()
|
||||
|
||||
option (TESTS_BUILD "Build tests" OFF)
|
||||
if (TESTS_BUILD)
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
if (${VULKAN_HPP_INSTALL})
|
||||
include(GNUInstallDirs)
|
||||
install(FILES ${VK_GENERATED_VULKAN_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vulkan)
|
||||
option( TESTS_BUILD "Build tests" OFF )
|
||||
if( TESTS_BUILD )
|
||||
add_subdirectory( tests )
|
||||
endif()
|
||||
|
||||
if( ${VULKAN_HPP_INSTALL} )
|
||||
include( GNUInstallDirs )
|
||||
install( FILES ${VK_GENERATED_VULKAN_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/vulkan )
|
||||
endif()
|
||||
|
@ -12,86 +12,76 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
option (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON)
|
||||
option (SAMPLES_BUILD_ONLY_DYNAMIC "Build only dynamic. Required in case the Vulkan SDK is not available" OFF)
|
||||
option( SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON )
|
||||
option( SAMPLES_BUILD_ONLY_DYNAMIC "Build only dynamic. Required in case the Vulkan SDK is not available" OFF )
|
||||
|
||||
if(NOT (SAMPLES_BUILD_ONLY_DYNAMIC AND SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP))
|
||||
find_package(Vulkan REQUIRED)
|
||||
if( NOT (SAMPLES_BUILD_ONLY_DYNAMIC AND SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP) )
|
||||
find_package( Vulkan REQUIRED )
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W4 /WX /permissive-)
|
||||
else(MSVC)
|
||||
add_compile_options(-Wall -Wextra -pedantic -Werror)
|
||||
endif(MSVC)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
add_definitions(-DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
add_definitions(-DVK_USE_PLATFORM_MACOS_MVK)
|
||||
if( MSVC )
|
||||
add_compile_options( /W4 /WX /permissive- )
|
||||
else()
|
||||
message(FATAL_ERROR, "Vulkan-Hpp: unhandled platform for samples!")
|
||||
add_compile_options( -Wall -Wextra -pedantic -Werror )
|
||||
endif()
|
||||
|
||||
if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP)
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include")
|
||||
if( SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP )
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/.." )
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include" )
|
||||
else()
|
||||
include_directories("${Vulkan_INCLUDE_DIRS}")
|
||||
include_directories( "${Vulkan_INCLUDE_DIRS}" )
|
||||
endif()
|
||||
|
||||
add_subdirectory(utils)
|
||||
add_subdirectory(01_InitInstance)
|
||||
add_subdirectory(02_EnumerateDevices)
|
||||
add_subdirectory(03_InitDevice)
|
||||
add_subdirectory(04_InitCommandBuffer)
|
||||
add_subdirectory(05_InitSwapchain)
|
||||
add_subdirectory(06_InitDepthBuffer)
|
||||
add_subdirectory(07_InitUniformBuffer)
|
||||
add_subdirectory(08_InitPipelineLayout)
|
||||
add_subdirectory(09_InitDescriptorSet)
|
||||
add_subdirectory(10_InitRenderPass)
|
||||
add_subdirectory(11_InitShaders)
|
||||
add_subdirectory(12_InitFrameBuffers)
|
||||
add_subdirectory(13_InitVertexBuffer)
|
||||
add_subdirectory(14_InitPipeline)
|
||||
add_subdirectory(15_DrawCube)
|
||||
add_subdirectory(16_Vulkan_1_1)
|
||||
add_subdirectory(CopyBlitImage)
|
||||
add_subdirectory(CreateDebugUtilsMessenger)
|
||||
add_subdirectory(DebugUtilsObjectName)
|
||||
add_subdirectory(DrawTexturedCube)
|
||||
add_subdirectory(DynamicUniform)
|
||||
add_subdirectory(EnableValidationWithCallback)
|
||||
add_subdirectory(EnumerateDevicesAdvanced)
|
||||
add_subdirectory(Events)
|
||||
add_subdirectory(ImmutableSampler)
|
||||
add_subdirectory(InitTexture)
|
||||
add_subdirectory(InputAttachment)
|
||||
add_subdirectory(InstanceExtensionProperties)
|
||||
add_subdirectory(InstanceLayerExtensionProperties)
|
||||
add_subdirectory(InstanceLayerProperties)
|
||||
add_subdirectory(InstanceVersion)
|
||||
add_subdirectory(MultipleSets)
|
||||
add_subdirectory(OcclusionQuery)
|
||||
add_subdirectory(PhysicalDeviceExtensions)
|
||||
add_subdirectory(PhysicalDeviceFeatures)
|
||||
add_subdirectory(PhysicalDeviceGroups)
|
||||
add_subdirectory(PhysicalDeviceMemoryProperties)
|
||||
add_subdirectory(PhysicalDeviceProperties)
|
||||
add_subdirectory(PhysicalDeviceQueueFamilyProperties)
|
||||
add_subdirectory(PipelineCache)
|
||||
add_subdirectory(PipelineDerivative)
|
||||
add_subdirectory(PushConstants)
|
||||
add_subdirectory(PushDescriptors)
|
||||
add_subdirectory(RayTracing)
|
||||
add_subdirectory(SecondaryCommandBuffer)
|
||||
add_subdirectory(SeparateImageSampler)
|
||||
add_subdirectory(SurfaceCapabilities)
|
||||
add_subdirectory(SurfaceFormats)
|
||||
add_subdirectory(Template)
|
||||
add_subdirectory(TexelBuffer)
|
||||
add_subdirectory( utils )
|
||||
add_subdirectory( 01_InitInstance )
|
||||
add_subdirectory( 02_EnumerateDevices )
|
||||
add_subdirectory( 03_InitDevice )
|
||||
add_subdirectory( 04_InitCommandBuffer )
|
||||
add_subdirectory( 05_InitSwapchain )
|
||||
add_subdirectory( 06_InitDepthBuffer )
|
||||
add_subdirectory( 07_InitUniformBuffer )
|
||||
add_subdirectory( 08_InitPipelineLayout )
|
||||
add_subdirectory( 09_InitDescriptorSet )
|
||||
add_subdirectory( 10_InitRenderPass )
|
||||
add_subdirectory( 11_InitShaders )
|
||||
add_subdirectory( 12_InitFrameBuffers )
|
||||
add_subdirectory( 13_InitVertexBuffer )
|
||||
add_subdirectory( 14_InitPipeline )
|
||||
add_subdirectory( 15_DrawCube )
|
||||
add_subdirectory( 16_Vulkan_1_1 )
|
||||
add_subdirectory( CopyBlitImage )
|
||||
add_subdirectory( CreateDebugUtilsMessenger )
|
||||
add_subdirectory( DebugUtilsObjectName )
|
||||
add_subdirectory( DrawTexturedCube )
|
||||
add_subdirectory( DynamicUniform )
|
||||
add_subdirectory( EnableValidationWithCallback )
|
||||
add_subdirectory( EnumerateDevicesAdvanced )
|
||||
add_subdirectory( Events )
|
||||
add_subdirectory( ImmutableSampler )
|
||||
add_subdirectory( InitTexture )
|
||||
add_subdirectory( InputAttachment )
|
||||
add_subdirectory( InstanceExtensionProperties )
|
||||
add_subdirectory( InstanceLayerExtensionProperties )
|
||||
add_subdirectory( InstanceLayerProperties )
|
||||
add_subdirectory( InstanceVersion )
|
||||
add_subdirectory( MultipleSets )
|
||||
add_subdirectory( OcclusionQuery )
|
||||
add_subdirectory( PhysicalDeviceExtensions )
|
||||
add_subdirectory( PhysicalDeviceFeatures )
|
||||
add_subdirectory( PhysicalDeviceGroups )
|
||||
add_subdirectory( PhysicalDeviceMemoryProperties )
|
||||
add_subdirectory( PhysicalDeviceProperties )
|
||||
add_subdirectory( PhysicalDeviceQueueFamilyProperties )
|
||||
add_subdirectory( PipelineCache )
|
||||
add_subdirectory( PipelineDerivative )
|
||||
add_subdirectory( PushConstants )
|
||||
add_subdirectory( PushDescriptors )
|
||||
add_subdirectory( RayTracing )
|
||||
add_subdirectory( SecondaryCommandBuffer )
|
||||
add_subdirectory( SeparateImageSampler )
|
||||
add_subdirectory( SurfaceCapabilities )
|
||||
add_subdirectory( SurfaceFormats )
|
||||
add_subdirectory( Template )
|
||||
add_subdirectory( TexelBuffer )
|
||||
|
@ -12,26 +12,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(RAII_utils LANGUAGES CXX)
|
||||
vulkan_hpp__setup_library( NAME RAII_utils HEADERS shaders.hpp utils.hpp )
|
||||
|
||||
set(HEADERS
|
||||
shaders.hpp
|
||||
utils.hpp
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_library(RAII_utils INTERFACE
|
||||
${SOURCES}
|
||||
${HEADERS}
|
||||
)
|
||||
|
||||
target_link_libraries(RAII_utils INTERFACE utils)
|
||||
target_compile_definitions(RAII_utils INTERFACE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
|
||||
target_link_libraries( RAII_utils INTERFACE utils )
|
||||
target_compile_definitions( RAII_utils INTERFACE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 )
|
||||
|
||||
|
@ -12,86 +12,76 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
option (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON)
|
||||
option (SAMPLES_BUILD_ONLY_DYNAMIC "Build only dynamic. Required in case the Vulkan SDK is not available" OFF)
|
||||
option( SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON )
|
||||
option( SAMPLES_BUILD_ONLY_DYNAMIC "Build only dynamic. Required in case the Vulkan SDK is not available" OFF )
|
||||
|
||||
if(NOT (SAMPLES_BUILD_ONLY_DYNAMIC AND SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP))
|
||||
find_package(Vulkan REQUIRED)
|
||||
if( NOT (SAMPLES_BUILD_ONLY_DYNAMIC AND SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP) )
|
||||
find_package( Vulkan REQUIRED )
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W4 /WX /permissive-)
|
||||
else(MSVC)
|
||||
add_compile_options(-Wall -Wextra -pedantic -Werror)
|
||||
endif(MSVC)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
add_definitions(-DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
add_definitions(-DVK_USE_PLATFORM_MACOS_MVK)
|
||||
if( MSVC )
|
||||
add_compile_options( /W4 /WX /permissive- )
|
||||
else()
|
||||
message(FATAL_ERROR, "Vulkan-Hpp: unhandled platform for samples!")
|
||||
add_compile_options( -Wall -Wextra -pedantic -Werror )
|
||||
endif()
|
||||
|
||||
if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP)
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include")
|
||||
if( SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP )
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/.." )
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include" )
|
||||
else()
|
||||
include_directories("${Vulkan_INCLUDE_DIRS}")
|
||||
include_directories( "${Vulkan_INCLUDE_DIRS}" )
|
||||
endif()
|
||||
|
||||
add_subdirectory(utils)
|
||||
add_subdirectory(01_InitInstance)
|
||||
add_subdirectory(02_EnumerateDevices)
|
||||
add_subdirectory(03_InitDevice)
|
||||
add_subdirectory(04_InitCommandBuffer)
|
||||
add_subdirectory(05_InitSwapchain)
|
||||
add_subdirectory(06_InitDepthBuffer)
|
||||
add_subdirectory(07_InitUniformBuffer)
|
||||
add_subdirectory(08_InitPipelineLayout)
|
||||
add_subdirectory(09_InitDescriptorSet)
|
||||
add_subdirectory(10_InitRenderPass)
|
||||
add_subdirectory(11_InitShaders)
|
||||
add_subdirectory(12_InitFrameBuffers)
|
||||
add_subdirectory(13_InitVertexBuffer)
|
||||
add_subdirectory(14_InitPipeline)
|
||||
add_subdirectory(15_DrawCube)
|
||||
add_subdirectory(16_Vulkan_1_1)
|
||||
add_subdirectory(CopyBlitImage)
|
||||
add_subdirectory(CreateDebugUtilsMessenger)
|
||||
add_subdirectory(DebugUtilsObjectName)
|
||||
add_subdirectory(DrawTexturedCube)
|
||||
add_subdirectory(DynamicUniform)
|
||||
add_subdirectory(EnableValidationWithCallback)
|
||||
add_subdirectory(EnumerateDevicesAdvanced)
|
||||
add_subdirectory(Events)
|
||||
add_subdirectory(ImmutableSampler)
|
||||
add_subdirectory(InitTexture)
|
||||
add_subdirectory(InputAttachment)
|
||||
add_subdirectory(InstanceExtensionProperties)
|
||||
add_subdirectory(InstanceLayerExtensionProperties)
|
||||
add_subdirectory(InstanceLayerProperties)
|
||||
add_subdirectory(InstanceVersion)
|
||||
add_subdirectory(MultipleSets)
|
||||
add_subdirectory(OcclusionQuery)
|
||||
add_subdirectory(PhysicalDeviceExtensions)
|
||||
add_subdirectory(PhysicalDeviceFeatures)
|
||||
add_subdirectory(PhysicalDeviceGroups)
|
||||
add_subdirectory(PhysicalDeviceMemoryProperties)
|
||||
add_subdirectory(PhysicalDeviceProperties)
|
||||
add_subdirectory(PhysicalDeviceQueueFamilyProperties)
|
||||
add_subdirectory(PipelineCache)
|
||||
add_subdirectory(PipelineDerivative)
|
||||
add_subdirectory(PushConstants)
|
||||
add_subdirectory(PushDescriptors)
|
||||
add_subdirectory(RayTracing)
|
||||
add_subdirectory(SecondaryCommandBuffer)
|
||||
add_subdirectory(SeparateImageSampler)
|
||||
add_subdirectory(SurfaceCapabilities)
|
||||
add_subdirectory(SurfaceFormats)
|
||||
add_subdirectory(Template)
|
||||
add_subdirectory(TexelBuffer)
|
||||
add_subdirectory( utils )
|
||||
add_subdirectory( 01_InitInstance )
|
||||
add_subdirectory( 02_EnumerateDevices )
|
||||
add_subdirectory( 03_InitDevice )
|
||||
add_subdirectory( 04_InitCommandBuffer )
|
||||
add_subdirectory( 05_InitSwapchain )
|
||||
add_subdirectory( 06_InitDepthBuffer )
|
||||
add_subdirectory( 07_InitUniformBuffer )
|
||||
add_subdirectory( 08_InitPipelineLayout )
|
||||
add_subdirectory( 09_InitDescriptorSet )
|
||||
add_subdirectory( 10_InitRenderPass )
|
||||
add_subdirectory( 11_InitShaders )
|
||||
add_subdirectory( 12_InitFrameBuffers )
|
||||
add_subdirectory( 13_InitVertexBuffer )
|
||||
add_subdirectory( 14_InitPipeline )
|
||||
add_subdirectory( 15_DrawCube )
|
||||
add_subdirectory( 16_Vulkan_1_1 )
|
||||
add_subdirectory( CopyBlitImage )
|
||||
add_subdirectory( CreateDebugUtilsMessenger )
|
||||
add_subdirectory( DebugUtilsObjectName )
|
||||
add_subdirectory( DrawTexturedCube )
|
||||
add_subdirectory( DynamicUniform )
|
||||
add_subdirectory( EnableValidationWithCallback )
|
||||
add_subdirectory( EnumerateDevicesAdvanced )
|
||||
add_subdirectory( Events )
|
||||
add_subdirectory( ImmutableSampler )
|
||||
add_subdirectory( InitTexture )
|
||||
add_subdirectory( InputAttachment )
|
||||
add_subdirectory( InstanceExtensionProperties )
|
||||
add_subdirectory( InstanceLayerExtensionProperties )
|
||||
add_subdirectory( InstanceLayerProperties )
|
||||
add_subdirectory( InstanceVersion )
|
||||
add_subdirectory( MultipleSets )
|
||||
add_subdirectory( OcclusionQuery )
|
||||
add_subdirectory( PhysicalDeviceExtensions )
|
||||
add_subdirectory( PhysicalDeviceFeatures )
|
||||
add_subdirectory( PhysicalDeviceGroups )
|
||||
add_subdirectory( PhysicalDeviceMemoryProperties )
|
||||
add_subdirectory( PhysicalDeviceProperties )
|
||||
add_subdirectory( PhysicalDeviceQueueFamilyProperties )
|
||||
add_subdirectory( PipelineCache )
|
||||
add_subdirectory( PipelineDerivative )
|
||||
add_subdirectory( PushConstants )
|
||||
add_subdirectory( PushDescriptors )
|
||||
add_subdirectory( RayTracing )
|
||||
add_subdirectory( SecondaryCommandBuffer )
|
||||
add_subdirectory( SeparateImageSampler )
|
||||
add_subdirectory( SurfaceCapabilities )
|
||||
add_subdirectory( SurfaceFormats )
|
||||
add_subdirectory( Template )
|
||||
add_subdirectory( TexelBuffer )
|
||||
|
@ -12,39 +12,19 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(utils LANGUAGES CXX)
|
||||
vulkan_hpp__setup_library( NAME utils HEADERS math.hpp shaders.hpp utils.hpp SOURCES math.cpp shaders.cpp utils.cpp )
|
||||
|
||||
set(HEADERS
|
||||
math.hpp
|
||||
shaders.hpp
|
||||
utils.hpp
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
math.cpp
|
||||
shaders.cpp
|
||||
utils.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_library(utils
|
||||
${SOURCES}
|
||||
${HEADERS}
|
||||
)
|
||||
|
||||
if (VULKAN_HPP_RUN_GENERATOR)
|
||||
add_dependencies(utils build_vulkan_hpp)
|
||||
if( VULKAN_HPP_RUN_GENERATOR )
|
||||
add_dependencies( utils build_vulkan_hpp )
|
||||
endif()
|
||||
|
||||
target_link_libraries(utils PUBLIC glm)
|
||||
target_link_libraries(utils PUBLIC glfw)
|
||||
target_link_libraries(utils PUBLIC glslang)
|
||||
target_link_libraries(utils PUBLIC glslang-default-resource-limits)
|
||||
target_link_libraries(utils PUBLIC SPIRV)
|
||||
target_compile_definitions(utils PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1)
|
||||
target_link_libraries( utils PUBLIC glm )
|
||||
target_link_libraries( utils PUBLIC glfw )
|
||||
target_link_libraries( utils PUBLIC glslang )
|
||||
target_link_libraries( utils PUBLIC glslang-default-resource-limits )
|
||||
target_link_libraries( utils PUBLIC SPIRV )
|
||||
target_compile_definitions (utils PUBLIC VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 )
|
||||
|
||||
target_precompile_headers(utils PRIVATE <vulkan/vulkan.hpp>)
|
||||
target_precompile_headers( utils PRIVATE <vulkan/vulkan.hpp> )
|
||||
|
@ -12,26 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
project(ArrayProxy LANGUAGES CXX)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
vulkan_hpp__setup_test( NAME ArrayProxy )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
ArrayProxy.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(ArrayProxy
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(ArrayProxy PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(ArrayProxy PRIVATE utils)
|
||||
set_target_properties( ArrayProxy PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( ArrayProxy PRIVATE utils )
|
||||
endif()
|
@ -12,26 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
project(ArrayProxyNoTemporaries LANGUAGES CXX)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
vulkan_hpp__setup_test( NAME ArrayProxyNoTemporaries )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
ArrayProxyNoTemporaries.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(ArrayProxyNoTemporaries
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(ArrayProxyNoTemporaries PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(ArrayProxyNoTemporaries PRIVATE utils)
|
||||
set_target_properties( ArrayProxyNoTemporaries PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( ArrayProxyNoTemporaries PRIVATE utils )
|
||||
endif()
|
@ -12,52 +12,44 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
option (TESTS_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON)
|
||||
option (TESTS_BUILD_ONLY_DYNAMIC "Build only dynamic" OFF)
|
||||
option( TESTS_BUILD_WITH_LOCAL_VULKAN_HPP "Build with local Vulkan headers" ON )
|
||||
option( TESTS_BUILD_ONLY_DYNAMIC "Build only dynamic" OFF )
|
||||
|
||||
if (NOT (TESTS_BUILD_ONLY_DYNAMIC AND TESTS_BUILD_WITH_LOCAL_VULKAN_HPP))
|
||||
find_package(Vulkan REQUIRED)
|
||||
if( NOT (TESTS_BUILD_ONLY_DYNAMIC AND TESTS_BUILD_WITH_LOCAL_VULKAN_HPP) )
|
||||
find_package( Vulkan REQUIRED )
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W4 /WX /permissive-)
|
||||
else(MSVC)
|
||||
add_compile_options(-Wall -Wextra -pedantic -Werror)
|
||||
endif(MSVC)
|
||||
|
||||
if (WIN32)
|
||||
add_definitions(-DNOMINMAX -DVK_USE_PLATFORM_WIN32_KHR)
|
||||
elseif(APPLE)
|
||||
add_definitions(-DVK_USE_PLATFORM_MACOS_MVK)
|
||||
elseif(UNIX)
|
||||
add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
|
||||
endif()
|
||||
|
||||
if (TESTS_BUILD_WITH_LOCAL_VULKAN_HPP)
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include")
|
||||
if( MSVC )
|
||||
add_compile_options( /W4 /WX /permissive- )
|
||||
else()
|
||||
include_directories("${Vulkan_INCLUDE_DIRS}")
|
||||
add_compile_options( -Wall -Wextra -pedantic -Werror )
|
||||
endif()
|
||||
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../glm")
|
||||
if( TESTS_BUILD_WITH_LOCAL_VULKAN_HPP )
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/.." )
|
||||
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include" )
|
||||
else()
|
||||
include_directories( "${Vulkan_INCLUDE_DIRS}" )
|
||||
endif()
|
||||
|
||||
add_subdirectory(ArrayProxy)
|
||||
add_subdirectory(ArrayProxyNoTemporaries)
|
||||
add_subdirectory(DesignatedInitializers)
|
||||
add_subdirectory(DeviceFunctions)
|
||||
add_subdirectory(DispatchLoaderDynamic)
|
||||
add_subdirectory(DispatchLoaderDynamicSharedLibrary)
|
||||
add_subdirectory(DispatchLoaderDynamicSharedLibraryClient)
|
||||
add_subdirectory(DispatchLoaderStatic)
|
||||
add_subdirectory(ExtensionInspection)
|
||||
add_subdirectory(Flags)
|
||||
add_subdirectory(FormatTraits)
|
||||
add_subdirectory(Hash)
|
||||
add_subdirectory(NoExceptions)
|
||||
add_subdirectory(StridedArrayProxy)
|
||||
add_subdirectory(StructureChain)
|
||||
add_subdirectory(UniqueHandle)
|
||||
add_subdirectory(UniqueHandleDefaultArguments)
|
||||
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/../glm" )
|
||||
|
||||
add_subdirectory( ArrayProxy )
|
||||
add_subdirectory( ArrayProxyNoTemporaries )
|
||||
add_subdirectory( DesignatedInitializers )
|
||||
add_subdirectory( DeviceFunctions )
|
||||
add_subdirectory( DispatchLoaderDynamic )
|
||||
add_subdirectory( DispatchLoaderDynamicSharedLibrary )
|
||||
add_subdirectory( DispatchLoaderDynamicSharedLibraryClient )
|
||||
add_subdirectory( DispatchLoaderStatic )
|
||||
add_subdirectory( ExtensionInspection )
|
||||
add_subdirectory( Flags )
|
||||
add_subdirectory( FormatTraits )
|
||||
add_subdirectory( Hash )
|
||||
add_subdirectory( NoExceptions )
|
||||
add_subdirectory( StridedArrayProxy )
|
||||
add_subdirectory( StructureChain )
|
||||
add_subdirectory( UniqueHandle )
|
||||
add_subdirectory( UniqueHandleDefaultArguments )
|
||||
|
@ -12,28 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
project(DesignatedInitializers LANGUAGES CXX)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
vulkan_hpp__setup_test( NAME DesignatedInitializers CXX_STANDARD 20 )
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
DesignatedInitializers.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(DesignatedInitializers
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(DesignatedInitializers PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(DesignatedInitializers PRIVATE utils)
|
||||
set_target_properties( DesignatedInitializers PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( DesignatedInitializers PRIVATE utils )
|
||||
endif()
|
@ -12,29 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
vulkan_hpp__setup_test( NAME DeviceFunctions )
|
||||
|
||||
find_package(Vulkan REQUIRED)
|
||||
find_package( Vulkan REQUIRED )
|
||||
|
||||
project(DeviceFunctions LANGUAGES CXX)
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
DeviceFunctions.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(DeviceFunctions
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(DeviceFunctions PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(DeviceFunctions PRIVATE utils ${Vulkan_LIBRARIES})
|
||||
set_target_properties( DeviceFunctions PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( DeviceFunctions PRIVATE utils ${Vulkan_LIBRARIES} )
|
||||
endif()
|
@ -12,28 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(DispatchLoaderDynamic LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME DispatchLoaderDynamic )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
DispatchLoaderDynamic.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(DispatchLoaderDynamic
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(DispatchLoaderDynamic PRIVATE ${CMAKE_DL_LIBS})
|
||||
if( UNIX )
|
||||
target_link_libraries( DispatchLoaderDynamic PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties(DispatchLoaderDynamic PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(DispatchLoaderDynamic PRIVATE utils)
|
||||
set_target_properties( DispatchLoaderDynamic PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( DispatchLoaderDynamic PRIVATE utils )
|
||||
|
@ -12,30 +12,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(DispatchLoaderDynamicSharedLibrary LANGUAGES CXX)
|
||||
vulkan_hpp__setup_library( NAME DispatchLoaderDynamicSharedLibrary SHARED SOURCES DispatchLoaderDynamicSharedLibrary.cpp )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
target_compile_definitions( DispatchLoaderDynamicSharedLibrary PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED VULKAN_HPP_STORAGE_SHARED_EXPORT )
|
||||
|
||||
set(SOURCES
|
||||
DispatchLoaderDynamicSharedLibrary.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_library(DispatchLoaderDynamicSharedLibrary SHARED
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
target_compile_definitions(DispatchLoaderDynamicSharedLibrary PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED VULKAN_HPP_STORAGE_SHARED_EXPORT )
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(DispatchLoaderDynamicSharedLibrary PRIVATE ${CMAKE_DL_LIBS})
|
||||
if( UNIX )
|
||||
target_link_libraries( DispatchLoaderDynamicSharedLibrary PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties(DispatchLoaderDynamicSharedLibrary PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(DispatchLoaderDynamicSharedLibrary PRIVATE utils)
|
||||
set_target_properties( DispatchLoaderDynamicSharedLibrary PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( DispatchLoaderDynamicSharedLibrary PRIVATE utils )
|
||||
|
@ -12,32 +12,17 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(DispatchLoaderDynamicSharedLibraryClient LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME DispatchLoaderDynamicSharedLibraryClient )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
target_compile_definitions( DispatchLoaderDynamicSharedLibraryClient PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED )
|
||||
|
||||
set(SOURCES
|
||||
DispatchLoaderDynamicSharedLibraryClient.cpp
|
||||
)
|
||||
target_link_libraries( DispatchLoaderDynamicSharedLibraryClient PRIVATE DispatchLoaderDynamicSharedLibrary )
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(DispatchLoaderDynamicSharedLibraryClient
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
target_compile_definitions(DispatchLoaderDynamicSharedLibraryClient PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED)
|
||||
|
||||
target_link_libraries(DispatchLoaderDynamicSharedLibraryClient PRIVATE DispatchLoaderDynamicSharedLibrary)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(DispatchLoaderDynamicSharedLibraryClient PRIVATE ${CMAKE_DL_LIBS})
|
||||
if( UNIX )
|
||||
target_link_libraries( DispatchLoaderDynamicSharedLibraryClient PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties(DispatchLoaderDynamicSharedLibraryClient PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(DispatchLoaderDynamicSharedLibraryClient PRIVATE utils)
|
||||
set_target_properties( DispatchLoaderDynamicSharedLibraryClient PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( DispatchLoaderDynamicSharedLibraryClient PRIVATE utils )
|
||||
|
@ -12,34 +12,17 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
find_package( Vulkan REQUIRED )
|
||||
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
project(DispatchLoaderStatic LANGUAGES CXX)
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
DispatchLoaderStatic.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(DispatchLoaderStatic
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(DispatchLoaderStatic PRIVATE ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
set_target_properties(DispatchLoaderStatic PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(DispatchLoaderStatic PRIVATE utils ${Vulkan_LIBRARIES})
|
||||
vulkan_hpp__setup_test( NAME DispatchLoaderStatic )
|
||||
|
||||
if( UNIX )
|
||||
target_link_libraries( DispatchLoaderStatic PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties( DispatchLoaderStatic PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( DispatchLoaderStatic PRIVATE utils ${Vulkan_LIBRARIES} )
|
||||
endif()
|
@ -12,24 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(ExtensionInspection LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME ExtensionInspection )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
ExtensionInspection.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(ExtensionInspection
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(ExtensionInspection PROPERTIES CXX_STANDARD 20 FOLDER "Tests")
|
||||
target_link_libraries(ExtensionInspection PRIVATE utils)
|
||||
set_target_properties( ExtensionInspection PROPERTIES CXX_STANDARD 20 FOLDER "Tests" )
|
||||
target_link_libraries( ExtensionInspection PRIVATE utils )
|
||||
|
@ -12,24 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(Flags LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME Flags )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
Flags.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(Flags
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(Flags PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(Flags PRIVATE utils)
|
||||
set_target_properties( Flags PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( Flags PRIVATE utils )
|
||||
|
@ -12,24 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(FormatTraits LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME FormatTraits )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
FormatTraits.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(FormatTraits
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(FormatTraits PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(FormatTraits PRIVATE utils)
|
||||
set_target_properties( FormatTraits PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( FormatTraits PRIVATE utils )
|
||||
|
@ -12,26 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
project(Hash LANGUAGES CXX)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
vulkan_hpp__setup_test( NAME Hash )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
Hash.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(Hash
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(Hash PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(Hash PRIVATE utils)
|
||||
set_target_properties( Hash PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( Hash PRIVATE utils )
|
||||
endif()
|
@ -12,27 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(NoExceptions LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME NoExceptions )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
NoExceptions.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(NoExceptions
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
if (UNIX)
|
||||
target_link_libraries(NoExceptions PRIVATE ${CMAKE_DL_LIBS})
|
||||
if( UNIX )
|
||||
target_link_libraries( NoExceptions PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif ()
|
||||
|
||||
set_target_properties(NoExceptions PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(NoExceptions PRIVATE utils)
|
||||
set_target_properties( NoExceptions PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( NoExceptions PRIVATE utils )
|
||||
|
@ -12,26 +12,11 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
if (NOT TESTS_BUILD_ONLY_DYNAMIC)
|
||||
project(StridedArrayProxy LANGUAGES CXX)
|
||||
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
|
||||
vulkan_hpp__setup_test( NAME StridedArrayProxy )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
StridedArrayProxy.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(StridedArrayProxy
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(StridedArrayProxy PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(StridedArrayProxy PRIVATE utils)
|
||||
set_target_properties( StridedArrayProxy PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( StridedArrayProxy PRIVATE utils )
|
||||
endif()
|
@ -12,28 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(StructureChain LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME StructureChain )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
StructureChain.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(StructureChain
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(StructureChain PRIVATE ${CMAKE_DL_LIBS})
|
||||
if( UNIX )
|
||||
target_link_libraries( StructureChain PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties(StructureChain PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(StructureChain PRIVATE utils)
|
||||
set_target_properties( StructureChain PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( StructureChain PRIVATE utils )
|
||||
|
@ -12,24 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(UniqueHandle LANGUAGES CXX)
|
||||
vulkan_hpp__setup_test( NAME UniqueHandle )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
UniqueHandle.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_executable(UniqueHandle
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(UniqueHandle PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(UniqueHandle PRIVATE utils)
|
||||
set_target_properties( UniqueHandle PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( UniqueHandle PRIVATE utils )
|
||||
|
@ -12,28 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
cmake_minimum_required( VERSION 3.2 )
|
||||
|
||||
project(UniqueHandleDefaultArguments LANGUAGES CXX)
|
||||
vulkan_hpp__setup_library( NAME UniqueHandleDefaultArguments SOURCES UniqueHandleDefaultArguments.cpp )
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
set(SOURCES
|
||||
UniqueHandleDefaultArguments.cpp
|
||||
)
|
||||
|
||||
source_group(headers FILES ${HEADERS})
|
||||
source_group(sources FILES ${SOURCES})
|
||||
|
||||
add_library(UniqueHandleDefaultArguments
|
||||
${HEADERS}
|
||||
${SOURCES}
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(UniqueHandleDefaultArguments PRIVATE ${CMAKE_DL_LIBS})
|
||||
if( UNIX )
|
||||
target_link_libraries( UniqueHandleDefaultArguments PRIVATE ${CMAKE_DL_LIBS} )
|
||||
endif()
|
||||
|
||||
set_target_properties(UniqueHandleDefaultArguments PROPERTIES FOLDER "Tests")
|
||||
target_link_libraries(UniqueHandleDefaultArguments PRIVATE utils)
|
||||
set_target_properties( UniqueHandleDefaultArguments PROPERTIES FOLDER "Tests" )
|
||||
target_link_libraries( UniqueHandleDefaultArguments PRIVATE utils )
|
||||
|
Loading…
Reference in New Issue
Block a user