From 9748e472281987695a2c5db065b13929d1035109 Mon Sep 17 00:00:00 2001 From: Jinesi Yelizati Date: Thu, 7 Jul 2022 16:22:21 +0800 Subject: [PATCH] Speed up CI by using ninja and parallel build (#1347) * chore(CI): speed up CI by using ninja and parallel build * chore(CI): align compiler for c and cxx * fix(samples): add dependency to generator * fix(cmake): get rid of file glob * chore(CI): use clang on mac glfw don't support gcc on mac * fix(sample): add depencency on build_vulkan_hpp * fix(cmake): make sure every target in tests and samples link to utils --- .github/workflows/ci-macos.yml | 17 ++++-- .github/workflows/ci-ubuntu.yml | 20 ++++-- .github/workflows/ci-windows.yml | 20 ++++-- CMakeLists.txt | 2 +- RAII_Samples/CMakeLists.txt | 61 ++++++++++++++++--- samples/01_InitInstance/CMakeLists.txt | 2 +- samples/CMakeLists.txt | 61 ++++++++++++++++--- .../CreateDebugUtilsMessenger/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../InstanceLayerProperties/CMakeLists.txt | 2 +- samples/InstanceVersion/CMakeLists.txt | 2 +- samples/utils/CMakeLists.txt | 4 ++ tests/ArrayProxy/CMakeLists.txt | 2 +- tests/ArrayProxyNoTemporaries/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 24 +++++--- tests/DesignatedInitializers/CMakeLists.txt | 2 +- tests/DeviceFunctions/CMakeLists.txt | 2 +- tests/DispatchLoaderDynamic/CMakeLists.txt | 3 +- .../CMakeLists.txt | 3 +- .../CMakeLists.txt | 5 +- tests/DispatchLoaderStatic/CMakeLists.txt | 5 +- tests/FormatTraits/CMakeLists.txt | 2 +- tests/Hash/CMakeLists.txt | 2 +- tests/NoExceptions/CMakeLists.txt | 6 +- tests/StructureChain/CMakeLists.txt | 3 +- .../CMakeLists.txt | 3 +- 27 files changed, 194 insertions(+), 67 deletions(-) diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index 4246794..539ec7c 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -9,7 +9,9 @@ jobs: strategy: matrix: build_type: [Debug, Release] - cxx_compiler: [g++-11, clang++] + compiler: + - {cxx: "g++-11", c: "clang"} + - {cxx: "clang++", c: "clang"} cxx_standard: [11, 14, 17, 20] steps: @@ -21,9 +23,14 @@ jobs: - name: Update Submodules run: git submodule update --init --recursive + + - name: Install Ninja + uses: ashutoshvarma/setup-ninja@master + with: + version: 1.11.0 - name: Configure CMake - run: cmake -B ${{github.workspace}}/build + run: cmake -B ${{github.workspace}}/build -GNinja -DSAMPLES_BUILD=ON -DSAMPLES_BUILD_ONLY_DYNAMIC=ON -DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON @@ -31,8 +38,10 @@ jobs: -DTESTS_BUILD_ONLY_DYNAMIC=ON -DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON -DVULKAN_HPP_RUN_GENERATOR=ON - -DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}} + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} + run: cmake --build ${{github.workspace}}/build --parallel diff --git a/.github/workflows/ci-ubuntu.yml b/.github/workflows/ci-ubuntu.yml index 5254404..3fb5cd6 100644 --- a/.github/workflows/ci-ubuntu.yml +++ b/.github/workflows/ci-ubuntu.yml @@ -12,7 +12,12 @@ jobs: strategy: matrix: build_type: [Debug, Release] - cxx_compiler: [g++-9, g++-10, clang++-10, clang++-11, clang++-12] + compiler: + - {cxx: "g++-9", c: "gcc-9"} + - {cxx: "g++-10", c: "gcc-10"} + - {cxx: "clang++-10", c: "clang-10"} + - {cxx: "clang++-11", c: "clang-11"} + - {cxx: "clang++-12", c: "clang-12"} cxx_standard: [11, 14, 17, 20] steps: @@ -23,9 +28,14 @@ jobs: - name: Update Submodules run: git submodule update --init --recursive + + - name: Install Ninja + uses: ashutoshvarma/setup-ninja@master + with: + version: 1.11.0 - name: Configure CMake - run: cmake -B ${{github.workspace}}/build + run: cmake -B ${{github.workspace}}/build -GNinja -DSAMPLES_BUILD=ON -DSAMPLES_BUILD_ONLY_DYNAMIC=ON -DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON @@ -33,8 +43,10 @@ jobs: -DTESTS_BUILD_ONLY_DYNAMIC=ON -DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON -DVULKAN_HPP_RUN_GENERATOR=ON - -DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}} + -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} + -DCMAKE_C_COMPILER=${{matrix.compiler.c}} -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} + run: cmake --build ${{github.workspace}}/build --parallel diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index b60b073..7997d6f 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [windows-latest, windows-2019] - architecture: [Win32, x64] + architecture: [x86, x64] build_type: [Debug, Release] cxx_standard: [11, 14, 17, 20] steps: @@ -20,10 +20,19 @@ jobs: - name: Update Submodules run: git submodule update --init --recursive + + - name: Install Ninja + uses: ashutoshvarma/setup-ninja@master + with: + version: 1.11.0 + + - name: Setup MSVC + uses: TheMrMilchmann/setup-msvc-dev@v1 + with: + arch: ${{matrix.architecture}} - name: Configure CMake - run: cmake -B ${{github.workspace}}/build - -A ${{matrix.architecture}} + run: cmake -B ${{github.workspace}}/build -GNinja -DSAMPLES_BUILD=ON -DSAMPLES_BUILD_ONLY_DYNAMIC=ON -DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON @@ -32,6 +41,7 @@ jobs: -DTESTS_BUILD_WITH_LOCAL_VULKAN_HPP=ON -DVULKAN_HPP_RUN_GENERATOR=ON -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} - + -DCMAKE_BUILD_TYPE=${{matrix.build_type}} + - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} + run: cmake --build ${{github.workspace}}/build --parallel diff --git a/CMakeLists.txt b/CMakeLists.txt index 12532d7..066c34c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ if (NOT DEFINED CMAKE_CXX_STANDARD) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) -message("CMAKE_CXX_STANDARD = <${CMAKE_CXX_STANDARD}>") +message(STATUS "CMAKE_CXX_STANDARD = <${CMAKE_CXX_STANDARD}>") if (NOT DEFINED VulkanRegistry_DIR) if (DEFINED VULKAN_HPP_VULKAN_HEADERS_SRC_DIR) diff --git a/RAII_Samples/CMakeLists.txt b/RAII_Samples/CMakeLists.txt index 7eb27f2..57ba78a 100644 --- a/RAII_Samples/CMakeLists.txt +++ b/RAII_Samples/CMakeLists.txt @@ -39,8 +39,6 @@ else() message(FATAL_ERROR, "Vulkan-Hpp: unhandled platform for samples!") endif() -FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*) - if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include") @@ -48,11 +46,54 @@ else() include_directories("${Vulkan_INCLUDE_DIRS}") endif() -FOREACH( linkunit ${linkunits} ) - if( IS_DIRECTORY ${linkunit} ) - if( EXISTS ${linkunit}/CMakeLists.txt ) - string( REGEX REPLACE "^.*/([^/]*)$" "\\1" LINK_NAME ${linkunit} ) - add_subdirectory( ${LINK_NAME} ) - endif() - endif() -ENDFOREACH( linkunit ${linkunits} ) +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) \ No newline at end of file diff --git a/samples/01_InitInstance/CMakeLists.txt b/samples/01_InitInstance/CMakeLists.txt index f13afb6..d8cd6b6 100644 --- a/samples/01_InitInstance/CMakeLists.txt +++ b/samples/01_InitInstance/CMakeLists.txt @@ -34,6 +34,6 @@ if(NOT SAMPLES_BUILD_ONLY_DYNAMIC) ) set_target_properties(01_InitInstance PROPERTIES FOLDER "Samples") - target_link_libraries(01_InitInstance "${Vulkan_LIBRARIES}") + target_link_libraries(01_InitInstance PRIVATE utils) endif() diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 9d28569..def94bb 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -39,8 +39,6 @@ else() message(FATAL_ERROR, "Vulkan-Hpp: unhandled platform for samples!") endif() -FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*) - if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include") @@ -48,11 +46,54 @@ else() include_directories("${Vulkan_INCLUDE_DIRS}") endif() -FOREACH( linkunit ${linkunits} ) - if( IS_DIRECTORY ${linkunit} ) - if( EXISTS ${linkunit}/CMakeLists.txt ) - string( REGEX REPLACE "^.*/([^/]*)$" "\\1" LINK_NAME ${linkunit} ) - add_subdirectory( ${LINK_NAME} ) - endif() - endif() -ENDFOREACH( linkunit ${linkunits} ) +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) diff --git a/samples/CreateDebugUtilsMessenger/CMakeLists.txt b/samples/CreateDebugUtilsMessenger/CMakeLists.txt index eae28c0..c57bb21 100644 --- a/samples/CreateDebugUtilsMessenger/CMakeLists.txt +++ b/samples/CreateDebugUtilsMessenger/CMakeLists.txt @@ -34,6 +34,6 @@ if(NOT SAMPLES_BUILD_ONLY_DYNAMIC) ) set_target_properties(CreateDebugUtilsMessenger PROPERTIES FOLDER "Samples") - target_link_libraries(CreateDebugUtilsMessenger "${Vulkan_LIBRARIES}") + target_link_libraries(CreateDebugUtilsMessenger PRIVATE utils) endif() diff --git a/samples/InstanceExtensionProperties/CMakeLists.txt b/samples/InstanceExtensionProperties/CMakeLists.txt index d878c39..0e1729a 100644 --- a/samples/InstanceExtensionProperties/CMakeLists.txt +++ b/samples/InstanceExtensionProperties/CMakeLists.txt @@ -34,6 +34,6 @@ if(NOT SAMPLES_BUILD_ONLY_DYNAMIC) ) set_target_properties(InstanceExtensionProperties PROPERTIES FOLDER "Samples") - target_link_libraries(InstanceExtensionProperties "${Vulkan_LIBRARIES}") + target_link_libraries(InstanceExtensionProperties PRIVATE utils) endif() diff --git a/samples/InstanceLayerExtensionProperties/CMakeLists.txt b/samples/InstanceLayerExtensionProperties/CMakeLists.txt index cdb7391..f233432 100644 --- a/samples/InstanceLayerExtensionProperties/CMakeLists.txt +++ b/samples/InstanceLayerExtensionProperties/CMakeLists.txt @@ -34,6 +34,6 @@ if(NOT SAMPLES_BUILD_ONLY_DYNAMIC) ) set_target_properties(InstanceLayerExtensionProperties PROPERTIES FOLDER "Samples") - target_link_libraries(InstanceLayerExtensionProperties "${Vulkan_LIBRARIES}") + target_link_libraries(InstanceLayerExtensionProperties PRIVATE utils) endif() diff --git a/samples/InstanceLayerProperties/CMakeLists.txt b/samples/InstanceLayerProperties/CMakeLists.txt index 99dc00b..6dd1364 100644 --- a/samples/InstanceLayerProperties/CMakeLists.txt +++ b/samples/InstanceLayerProperties/CMakeLists.txt @@ -34,6 +34,6 @@ if(NOT SAMPLES_BUILD_ONLY_DYNAMIC) ) set_target_properties(InstanceLayerProperties PROPERTIES FOLDER "Samples") - target_link_libraries(InstanceLayerProperties "${Vulkan_LIBRARIES}") + target_link_libraries(InstanceLayerProperties PRIVATE utils) endif() diff --git a/samples/InstanceVersion/CMakeLists.txt b/samples/InstanceVersion/CMakeLists.txt index 9d49153..05c83ca 100644 --- a/samples/InstanceVersion/CMakeLists.txt +++ b/samples/InstanceVersion/CMakeLists.txt @@ -34,6 +34,6 @@ if(NOT SAMPLES_BUILD_ONLY_DYNAMIC) ) set_target_properties(InstanceVersion PROPERTIES FOLDER "Samples") - target_link_libraries(InstanceVersion "${Vulkan_LIBRARIES}") + target_link_libraries(InstanceVersion PRIVATE utils) endif() diff --git a/samples/utils/CMakeLists.txt b/samples/utils/CMakeLists.txt index 06ae47c..ed4d5ec 100644 --- a/samples/utils/CMakeLists.txt +++ b/samples/utils/CMakeLists.txt @@ -36,6 +36,10 @@ add_library(utils ${HEADERS} ) +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) diff --git a/tests/ArrayProxy/CMakeLists.txt b/tests/ArrayProxy/CMakeLists.txt index 0adcdc6..14b449b 100644 --- a/tests/ArrayProxy/CMakeLists.txt +++ b/tests/ArrayProxy/CMakeLists.txt @@ -33,5 +33,5 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC) ) set_target_properties(ArrayProxy PROPERTIES FOLDER "Tests") - target_link_libraries(ArrayProxy "${Vulkan_LIBRARIES}") + target_link_libraries(ArrayProxy PRIVATE utils) endif() \ No newline at end of file diff --git a/tests/ArrayProxyNoTemporaries/CMakeLists.txt b/tests/ArrayProxyNoTemporaries/CMakeLists.txt index 3e4a4b7..f2d9811 100644 --- a/tests/ArrayProxyNoTemporaries/CMakeLists.txt +++ b/tests/ArrayProxyNoTemporaries/CMakeLists.txt @@ -33,5 +33,5 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC) ) set_target_properties(ArrayProxyNoTemporaries PROPERTIES FOLDER "Tests") - target_link_libraries(ArrayProxyNoTemporaries "${Vulkan_LIBRARIES}") + target_link_libraries(ArrayProxyNoTemporaries PRIVATE utils) endif() \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 05cf279..d1a3e3b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -38,8 +38,6 @@ elseif(UNIX) add_definitions(-DVK_USE_PLATFORM_XLIB_KHR) endif() -FILE (GLOB linkunits ${CMAKE_CURRENT_SOURCE_DIR}/*) - if (TESTS_BUILD_WITH_LOCAL_VULKAN_HPP) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Headers/include") @@ -49,11 +47,17 @@ endif() include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../glm") -FOREACH( linkunit ${linkunits} ) - if( IS_DIRECTORY ${linkunit} ) - if( EXISTS ${linkunit}/CMakeLists.txt ) - string( REGEX REPLACE "^.*/([^/]*)$" "\\1" LINK_NAME ${linkunit} ) - add_subdirectory( ${LINK_NAME} ) - endif() - endif() -ENDFOREACH( linkunit ${linkunits} ) +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(FormatTraits) +add_subdirectory(Hash) +add_subdirectory(NoExceptions) +add_subdirectory(StructureChain) +add_subdirectory(UniqueHandle) +add_subdirectory(UniqueHandleDefaultArguments) diff --git a/tests/DesignatedInitializers/CMakeLists.txt b/tests/DesignatedInitializers/CMakeLists.txt index a9d0fd5..9fed073 100644 --- a/tests/DesignatedInitializers/CMakeLists.txt +++ b/tests/DesignatedInitializers/CMakeLists.txt @@ -35,5 +35,5 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC) ) set_target_properties(DesignatedInitializers PROPERTIES FOLDER "Tests") - target_link_libraries(DesignatedInitializers "${Vulkan_LIBRARIES}") + target_link_libraries(DesignatedInitializers PRIVATE utils) endif() \ No newline at end of file diff --git a/tests/DeviceFunctions/CMakeLists.txt b/tests/DeviceFunctions/CMakeLists.txt index 2769714..bb15ca8 100644 --- a/tests/DeviceFunctions/CMakeLists.txt +++ b/tests/DeviceFunctions/CMakeLists.txt @@ -33,5 +33,5 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC) ) set_target_properties(DeviceFunctions PROPERTIES FOLDER "Tests") - target_link_libraries(DeviceFunctions "${Vulkan_LIBRARIES}") + target_link_libraries(DeviceFunctions PRIVATE utils) endif() \ No newline at end of file diff --git a/tests/DispatchLoaderDynamic/CMakeLists.txt b/tests/DispatchLoaderDynamic/CMakeLists.txt index 2cb1638..22f4b92 100644 --- a/tests/DispatchLoaderDynamic/CMakeLists.txt +++ b/tests/DispatchLoaderDynamic/CMakeLists.txt @@ -32,7 +32,8 @@ add_executable(DispatchLoaderDynamic ) if (UNIX) - target_link_libraries(DispatchLoaderDynamic "-ldl") + target_link_libraries(DispatchLoaderDynamic PRIVATE ${CMAKE_DL_LIBS}) endif() set_target_properties(DispatchLoaderDynamic PROPERTIES FOLDER "Tests") +target_link_libraries(DispatchLoaderDynamic PRIVATE utils) diff --git a/tests/DispatchLoaderDynamicSharedLibrary/CMakeLists.txt b/tests/DispatchLoaderDynamicSharedLibrary/CMakeLists.txt index ea93710..fe41837 100644 --- a/tests/DispatchLoaderDynamicSharedLibrary/CMakeLists.txt +++ b/tests/DispatchLoaderDynamicSharedLibrary/CMakeLists.txt @@ -34,7 +34,8 @@ add_library(DispatchLoaderDynamicSharedLibrary SHARED 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 "-ldl") + target_link_libraries(DispatchLoaderDynamicSharedLibrary PRIVATE ${CMAKE_DL_LIBS}) endif() set_target_properties(DispatchLoaderDynamicSharedLibrary PROPERTIES FOLDER "Tests") +target_link_libraries(DispatchLoaderDynamicSharedLibrary PRIVATE utils) diff --git a/tests/DispatchLoaderDynamicSharedLibraryClient/CMakeLists.txt b/tests/DispatchLoaderDynamicSharedLibraryClient/CMakeLists.txt index 75165b7..38f0595 100644 --- a/tests/DispatchLoaderDynamicSharedLibraryClient/CMakeLists.txt +++ b/tests/DispatchLoaderDynamicSharedLibraryClient/CMakeLists.txt @@ -33,10 +33,11 @@ add_executable(DispatchLoaderDynamicSharedLibraryClient target_compile_definitions(DispatchLoaderDynamicSharedLibraryClient PRIVATE VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VULKAN_HPP_STORAGE_SHARED) -target_link_libraries(DispatchLoaderDynamicSharedLibraryClient DispatchLoaderDynamicSharedLibrary) +target_link_libraries(DispatchLoaderDynamicSharedLibraryClient PRIVATE DispatchLoaderDynamicSharedLibrary) if (UNIX) - target_link_libraries(DispatchLoaderDynamicSharedLibraryClient "-ldl") + target_link_libraries(DispatchLoaderDynamicSharedLibraryClient PRIVATE ${CMAKE_DL_LIBS}) endif() set_target_properties(DispatchLoaderDynamicSharedLibraryClient PROPERTIES FOLDER "Tests") +target_link_libraries(DispatchLoaderDynamicSharedLibraryClient PRIVATE utils) diff --git a/tests/DispatchLoaderStatic/CMakeLists.txt b/tests/DispatchLoaderStatic/CMakeLists.txt index 6ec1d7e..2e25da1 100644 --- a/tests/DispatchLoaderStatic/CMakeLists.txt +++ b/tests/DispatchLoaderStatic/CMakeLists.txt @@ -34,11 +34,10 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC) ) if (UNIX) - target_link_libraries(DispatchLoaderStatic "-ldl") + target_link_libraries(DispatchLoaderStatic PRIVATE ${CMAKE_DL_LIBS}) endif() - target_link_libraries(DispatchLoaderStatic "${Vulkan_LIBRARIES}") - set_target_properties(DispatchLoaderStatic PROPERTIES FOLDER "Tests") + target_link_libraries(DispatchLoaderStatic PRIVATE utils) endif() \ No newline at end of file diff --git a/tests/FormatTraits/CMakeLists.txt b/tests/FormatTraits/CMakeLists.txt index cdba885..2bb7cad 100644 --- a/tests/FormatTraits/CMakeLists.txt +++ b/tests/FormatTraits/CMakeLists.txt @@ -32,4 +32,4 @@ add_executable(FormatTraits ) set_target_properties(FormatTraits PROPERTIES FOLDER "Tests") -target_link_libraries(FormatTraits "${Vulkan_LIBRARIES}") +target_link_libraries(FormatTraits PRIVATE utils) diff --git a/tests/Hash/CMakeLists.txt b/tests/Hash/CMakeLists.txt index 37a7e7d..546c111 100644 --- a/tests/Hash/CMakeLists.txt +++ b/tests/Hash/CMakeLists.txt @@ -33,5 +33,5 @@ if (NOT TESTS_BUILD_ONLY_DYNAMIC) ) set_target_properties(Hash PROPERTIES FOLDER "Tests") - target_link_libraries(Hash "${Vulkan_LIBRARIES}") + target_link_libraries(Hash PRIVATE utils) endif() \ No newline at end of file diff --git a/tests/NoExceptions/CMakeLists.txt b/tests/NoExceptions/CMakeLists.txt index 2e055f2..40b4b84 100644 --- a/tests/NoExceptions/CMakeLists.txt +++ b/tests/NoExceptions/CMakeLists.txt @@ -30,7 +30,9 @@ add_executable(NoExceptions ${HEADERS} ${SOURCES} ) - -target_link_libraries(NoExceptions ${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) diff --git a/tests/StructureChain/CMakeLists.txt b/tests/StructureChain/CMakeLists.txt index ad05f73..d72d294 100644 --- a/tests/StructureChain/CMakeLists.txt +++ b/tests/StructureChain/CMakeLists.txt @@ -32,7 +32,8 @@ add_executable(StructureChain ) if (UNIX) - target_link_libraries(StructureChain "-ldl") + target_link_libraries(StructureChain PRIVATE ${CMAKE_DL_LIBS}) endif() set_target_properties(StructureChain PROPERTIES FOLDER "Tests") +target_link_libraries(StructureChain PRIVATE utils) diff --git a/tests/UniqueHandleDefaultArguments/CMakeLists.txt b/tests/UniqueHandleDefaultArguments/CMakeLists.txt index e1e1f28..d67b848 100644 --- a/tests/UniqueHandleDefaultArguments/CMakeLists.txt +++ b/tests/UniqueHandleDefaultArguments/CMakeLists.txt @@ -32,7 +32,8 @@ add_library(UniqueHandleDefaultArguments ) if (UNIX) - target_link_libraries(UniqueHandleDefaultArguments "-ldl") + target_link_libraries(UniqueHandleDefaultArguments PRIVATE ${CMAKE_DL_LIBS}) endif() set_target_properties(UniqueHandleDefaultArguments PROPERTIES FOLDER "Tests") +target_link_libraries(UniqueHandleDefaultArguments PRIVATE utils)