From 9e4f6812fb4299e8f1471face2052c871e00b595 Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Wed, 8 Dec 2021 09:34:04 +0100 Subject: [PATCH] Add CI on MacOS. --- .github/workflows/ci-macos.yml | 38 +++++++++++++++++++++++++++++++ RAII_Samples/CMakeLists.txt | 2 ++ RAII_Samples/utils/CMakeLists.txt | 6 ++--- glslang | 2 +- samples/CMakeLists.txt | 2 ++ tests/CMakeLists.txt | 2 ++ 6 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 0000000..4246794 --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,38 @@ + +name: CI MacOS + +on: [push, pull_request] +jobs: + build: + runs-on: macos-latest + + strategy: + matrix: + build_type: [Debug, Release] + cxx_compiler: [g++-11, clang++] + cxx_standard: [11, 14, 17, 20] + + steps: + - uses: actions/checkout@v2 + + - name: Install libraries + run: | + brew install clang-format molten-vk + + - name: Update Submodules + run: git submodule update --init --recursive + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build + -DSAMPLES_BUILD=ON + -DSAMPLES_BUILD_ONLY_DYNAMIC=ON + -DSAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP=ON + -DTESTS_BUILD=ON + -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_STANDARD=${{matrix.cxx_standard}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} diff --git a/RAII_Samples/CMakeLists.txt b/RAII_Samples/CMakeLists.txt index 3fa6a36..7eb27f2 100644 --- a/RAII_Samples/CMakeLists.txt +++ b/RAII_Samples/CMakeLists.txt @@ -33,6 +33,8 @@ 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!") endif() diff --git a/RAII_Samples/utils/CMakeLists.txt b/RAII_Samples/utils/CMakeLists.txt index 272b3de..d7a2ebf 100644 --- a/RAII_Samples/utils/CMakeLists.txt +++ b/RAII_Samples/utils/CMakeLists.txt @@ -27,11 +27,11 @@ set(SOURCES source_group(headers FILES ${HEADERS}) source_group(sources FILES ${SOURCES}) -add_library(RAII_utils +add_library(RAII_utils INTERFACE ${SOURCES} ${HEADERS} ) -target_link_libraries(RAII_utils PRIVATE utils) -target_compile_definitions(RAII_utils PUBLIC 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) diff --git a/glslang b/glslang index 3ee5f2f..bffcf20 160000 --- a/glslang +++ b/glslang @@ -1 +1 @@ -Subproject commit 3ee5f2f1d3316e228916788b300d786bb574d337 +Subproject commit bffcf209cb67f718bd8faafd43d0379f943c116f diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 5da13de..9d28569 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -33,6 +33,8 @@ 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!") endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3ea58c6..05cf279 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -32,6 +32,8 @@ 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()