Cleanup up on CMakeLists.txt (#1564)

This commit is contained in:
Andreas Süßenbach 2023-04-20 16:50:26 +02:00 committed by GitHub
parent 20cb37e39f
commit e1d6ec8abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 571 additions and 838 deletions

View File

@ -26,12 +26,180 @@
cmake_minimum_required(VERSION 3.12)
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()
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 )
project(VulkanHppGenerator LANGUAGES CXX)
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 )
@ -68,13 +236,6 @@ else()
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)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "CMAKE_CXX_STANDARD = <${CMAKE_CXX_STANDARD}>")
if( NOT DEFINED VulkanRegistry_DIR )
if( DEFINED VULKAN_HPP_VULKAN_HEADERS_SRC_DIR )
set( VulkanRegistry_DIR "${VULKAN_HPP_VULKAN_HEADERS_SRC_DIR}/registry" )
@ -84,7 +245,8 @@ if (NOT DEFINED VulkanRegistry_DIR)
endif()
file( TO_NATIVE_PATH ${VulkanRegistry_DIR}/vk.xml vk_spec )
string( REPLACE "\\" "\\\\" vk_spec ${vk_spec} )
add_definitions(-DVK_SPEC="${vk_spec}")
project( VulkanHppGenerator LANGUAGES CXX )
if( NOT DEFINED VulkanHeaders_INCLUDE_DIR )
if( DEFINED VULKAN_HPP_PATH )
@ -95,25 +257,17 @@ if (NOT DEFINED VulkanHeaders_INCLUDE_DIR)
endif()
include_directories( ${VulkanHeaders_INCLUDE_DIR} )
set(HEADERS
VulkanHppGenerator.hpp
)
set( HEADERS VulkanHppGenerator.hpp )
set(SOURCES
VulkanHppGenerator.cpp
)
set( SOURCES VulkanHppGenerator.cpp )
if( NOT DEFINED VULKAN_HPP_TINYXML2_SRC_DIR )
set( VULKAN_HPP_TINYXML2_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tinyxml2" )
endif()
set(TINYXML2_SOURCES
${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.cpp
)
set( TINYXML2_SOURCES ${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.cpp )
set(TINYXML2_HEADERS
${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.h
)
set( TINYXML2_HEADERS ${VULKAN_HPP_TINYXML2_SRC_DIR}/tinyxml2.h )
source_group( headers FILES ${HEADERS} )
source_group( sources FILES ${SOURCES} )
@ -128,6 +282,8 @@ add_executable(VulkanHppGenerator
${TINYXML2_HEADERS}
)
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
@ -144,9 +300,7 @@ set(VK_GENERATED_VULKAN_HEADERS
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)
set_target_properties( ${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON )
if( MSVC )
target_compile_options(${PROJECT_NAME} PRIVATE /W4 /WX )
@ -169,109 +323,11 @@ if (VULKAN_HPP_RUN_GENERATOR)
COMMENT "run ${PROJECT_NAME}"
DEPENDS ${PROJECT_NAME} "${vk_spec}" )
add_custom_target(build_vulkan_hpp ALL
DEPENDS "${vulkan_hpp}" "${vk_spec}")
add_custom_target( build_vulkan_hpp ALL DEPENDS "${vulkan_hpp}" "${vk_spec}" )
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

View File

@ -23,18 +23,8 @@ 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)
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 )

View File

@ -14,23 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(RAII_utils LANGUAGES CXX)
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}
)
vulkan_hpp__setup_library( NAME RAII_utils HEADERS shaders.hpp utils.hpp )
target_link_libraries( RAII_utils INTERFACE utils )
target_compile_definitions( RAII_utils INTERFACE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 )

View File

@ -23,18 +23,8 @@ 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)
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 )

View File

@ -14,27 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(utils LANGUAGES CXX)
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}
)
vulkan_hpp__setup_library( NAME utils HEADERS math.hpp shaders.hpp utils.hpp SOURCES math.cpp shaders.cpp utils.cpp )
if( VULKAN_HPP_RUN_GENERATOR )
add_dependencies( utils build_vulkan_hpp )

View File

@ -15,22 +15,7 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
project(ArrayProxy LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
ArrayProxy.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(ArrayProxy
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME ArrayProxy )
set_target_properties( ArrayProxy PROPERTIES FOLDER "Tests" )
target_link_libraries( ArrayProxy PRIVATE utils )

View File

@ -15,22 +15,7 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
project(ArrayProxyNoTemporaries LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
ArrayProxyNoTemporaries.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(ArrayProxyNoTemporaries
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME ArrayProxyNoTemporaries )
set_target_properties( ArrayProxyNoTemporaries PROPERTIES FOLDER "Tests" )
target_link_libraries( ArrayProxyNoTemporaries PRIVATE utils )

View File

@ -23,16 +23,8 @@ endif()
if( MSVC )
add_compile_options( /W4 /WX /permissive- )
else(MSVC)
else()
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 )

View File

@ -15,24 +15,7 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
project(DesignatedInitializers LANGUAGES CXX)
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}
)
vulkan_hpp__setup_test( NAME DesignatedInitializers CXX_STANDARD 20 )
set_target_properties( DesignatedInitializers PROPERTIES FOLDER "Tests" )
target_link_libraries( DesignatedInitializers PRIVATE utils )

View File

@ -15,26 +15,10 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
vulkan_hpp__setup_test( NAME DeviceFunctions )
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} )
endif()

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(DispatchLoaderDynamic LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
DispatchLoaderDynamic.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(DispatchLoaderDynamic
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME DispatchLoaderDynamic )
if( UNIX )
target_link_libraries( DispatchLoaderDynamic PRIVATE ${CMAKE_DL_LIBS} )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(DispatchLoaderDynamicSharedLibrary LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
DispatchLoaderDynamicSharedLibrary.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_library(DispatchLoaderDynamicSharedLibrary SHARED
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_library( NAME DispatchLoaderDynamicSharedLibrary SHARED SOURCES DispatchLoaderDynamicSharedLibrary.cpp )
target_compile_definitions( DispatchLoaderDynamicSharedLibrary PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED VULKAN_HPP_STORAGE_SHARED_EXPORT )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(DispatchLoaderDynamicSharedLibraryClient LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
DispatchLoaderDynamicSharedLibraryClient.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(DispatchLoaderDynamicSharedLibraryClient
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME DispatchLoaderDynamicSharedLibraryClient )
target_compile_definitions( DispatchLoaderDynamicSharedLibraryClient PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED )

View File

@ -15,25 +15,9 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
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}
)
vulkan_hpp__setup_test( NAME DispatchLoaderStatic )
if( UNIX )
target_link_libraries( DispatchLoaderStatic PRIVATE ${CMAKE_DL_LIBS} )
@ -41,5 +25,4 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC)
set_target_properties( DispatchLoaderStatic PROPERTIES FOLDER "Tests" )
target_link_libraries( DispatchLoaderStatic PRIVATE utils ${Vulkan_LIBRARIES} )
endif()

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(ExtensionInspection LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
ExtensionInspection.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(ExtensionInspection
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME ExtensionInspection )
set_target_properties( ExtensionInspection PROPERTIES CXX_STANDARD 20 FOLDER "Tests" )
target_link_libraries( ExtensionInspection PRIVATE utils )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(Flags LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
Flags.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(Flags
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME Flags )
set_target_properties( Flags PROPERTIES FOLDER "Tests" )
target_link_libraries( Flags PRIVATE utils )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(FormatTraits LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
FormatTraits.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(FormatTraits
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME FormatTraits )
set_target_properties( FormatTraits PROPERTIES FOLDER "Tests" )
target_link_libraries( FormatTraits PRIVATE utils )

View File

@ -15,22 +15,7 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
project(Hash LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
Hash.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(Hash
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME Hash )
set_target_properties( Hash PROPERTIES FOLDER "Tests" )
target_link_libraries( Hash PRIVATE utils )

View File

@ -14,22 +14,8 @@
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} )
endif ()

View File

@ -15,22 +15,7 @@
cmake_minimum_required( VERSION 3.2 )
if( NOT TESTS_BUILD_ONLY_DYNAMIC )
project(StridedArrayProxy LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
StridedArrayProxy.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(StridedArrayProxy
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME StridedArrayProxy )
set_target_properties( StridedArrayProxy PROPERTIES FOLDER "Tests" )
target_link_libraries( StridedArrayProxy PRIVATE utils )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(StructureChain LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
StructureChain.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(StructureChain
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME StructureChain )
if( UNIX )
target_link_libraries( StructureChain PRIVATE ${CMAKE_DL_LIBS} )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(UniqueHandle LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
UniqueHandle.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_executable(UniqueHandle
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_test( NAME UniqueHandle )
set_target_properties( UniqueHandle PROPERTIES FOLDER "Tests" )
target_link_libraries( UniqueHandle PRIVATE utils )

View File

@ -14,22 +14,7 @@
cmake_minimum_required( VERSION 3.2 )
project(UniqueHandleDefaultArguments LANGUAGES CXX)
set(HEADERS
)
set(SOURCES
UniqueHandleDefaultArguments.cpp
)
source_group(headers FILES ${HEADERS})
source_group(sources FILES ${SOURCES})
add_library(UniqueHandleDefaultArguments
${HEADERS}
${SOURCES}
)
vulkan_hpp__setup_library( NAME UniqueHandleDefaultArguments SOURCES UniqueHandleDefaultArguments.cpp )
if( UNIX )
target_link_libraries( UniqueHandleDefaultArguments PRIVATE ${CMAKE_DL_LIBS} )