Skip to content

Commit fd31f90

Browse files
fix(sdl): build SDL backend on all host platforms
Enable the preview.sdl target for any host build, not just Windows, so the SDL DirectDisplay can be used from Linux/macOS host applications. - gate preview/sdl on EMIL_HOST_BUILD instead of EMIL_BUILD_WIN - avoid taking the address of a temporary SDL_Rect in Convert(), which fails to compile under GCC/Clang with -Werror - drop a duplicate Colour.hpp include
1 parent 85b0f61 commit fd31f90

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

preview/sdl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (EMIL_BUILD_WIN AND PREVIEW_INCLUDE_SDL)
1+
if (EMIL_HOST_BUILD AND PREVIEW_INCLUDE_SDL)
22
include(FetchContent)
33

44
FetchContent_Declare(

preview/sdl/DirectDisplaySdl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include "preview/sdl/DirectDisplaySdl.hpp"
2-
#include "preview/interfaces/Colour.hpp"
32
#include "SDL3/SDL.h"
43
#include "preview/interfaces/Colour.hpp"
54

@@ -8,7 +7,8 @@ namespace
87
SDL_FRect Convert(infra::Region region)
98
{
109
SDL_FRect result;
11-
SDL_RectToFRect(&SDL_Rect{ region.TopLeft().x, region.TopLeft().y, region.Width(), region.Height() }, &result);
10+
SDL_Rect rect{ region.TopLeft().x, region.TopLeft().y, region.Width(), region.Height() };
11+
SDL_RectToFRect(&rect, &result);
1212
return result;
1313
}
1414
}

0 commit comments

Comments
 (0)