diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31ac1c3..9e7d0c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: @@ -33,6 +33,11 @@ jobs: with: key: ${{ github.job }}-${{ matrix.os }} variant: sccache + - name: Install SDL X11 dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libxtst-dev libxkbcommon-dev - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "continuous-integration" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b0b8240..80b3ad3 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -36,6 +36,10 @@ jobs: with: key: ${{ github.job }} max-size: 2G + - name: Install SDL X11 dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libxtst-dev libxkbcommon-dev - name: Build & Collect Coverage run: | cmake --preset coverage -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache @@ -70,6 +74,10 @@ jobs: - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: languages: cpp + - name: Install SDL X11 dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libxtst-dev libxkbcommon-dev - uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9 with: configurePreset: "continuous-integration" diff --git a/preview/sdl/CMakeLists.txt b/preview/sdl/CMakeLists.txt index 7490013..26f1d39 100644 --- a/preview/sdl/CMakeLists.txt +++ b/preview/sdl/CMakeLists.txt @@ -1,4 +1,4 @@ -if (EMIL_BUILD_WIN AND PREVIEW_INCLUDE_SDL) +if (EMIL_HOST_BUILD AND PREVIEW_INCLUDE_SDL) include(FetchContent) FetchContent_Declare( diff --git a/preview/sdl/DirectDisplaySdl.cpp b/preview/sdl/DirectDisplaySdl.cpp index e15c325..5717803 100644 --- a/preview/sdl/DirectDisplaySdl.cpp +++ b/preview/sdl/DirectDisplaySdl.cpp @@ -1,5 +1,4 @@ #include "preview/sdl/DirectDisplaySdl.hpp" -#include "preview/interfaces/Colour.hpp" #include "SDL3/SDL.h" #include "preview/interfaces/Colour.hpp" @@ -8,7 +7,8 @@ namespace SDL_FRect Convert(infra::Region region) { SDL_FRect result; - SDL_RectToFRect(&SDL_Rect{ region.TopLeft().x, region.TopLeft().y, region.Width(), region.Height() }, &result); + SDL_Rect rect{ region.TopLeft().x, region.TopLeft().y, region.Width(), region.Height() }; + SDL_RectToFRect(&rect, &result); return result; } }