Skip to content

Commit da6e9bb

Browse files
committed
Allow building the tray subsystem without the video subsystem
Fixes #13235
1 parent 943d0f6 commit da6e9bb

18 files changed

+219
-263
lines changed

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ define_sdl_subsystem(Hidapi)
253253
define_sdl_subsystem(Power)
254254
define_sdl_subsystem(Sensor)
255255
define_sdl_subsystem(Dialog)
256+
define_sdl_subsystem(Tray)
256257

257258
cmake_dependent_option(SDL_FRAMEWORK "Build SDL libraries as Apple Framework" OFF "APPLE" OFF)
258259
if(SDL_FRAMEWORK)
@@ -410,6 +411,7 @@ if (NGAGE)
410411
set(SDL_DUMMYVIDEO OFF)
411412
set(SDL_OFFSCREEN OFF)
412413
set(SDL_RENDER_GPU OFF)
414+
set(SDL_TRAY OFF)
413415
set(SDL_VIRTUAL_JOYSTICK OFF)
414416
endif()
415417

@@ -1752,7 +1754,9 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
17521754
CheckVivante()
17531755
CheckVulkan()
17541756
CheckQNXScreen()
1757+
endif()
17551758

1759+
if(SDL_TRAY)
17561760
sdl_glob_sources(
17571761
"${SDL3_SOURCE_DIR}/src/tray/unix/*.c"
17581762
"${SDL3_SOURCE_DIR}/src/tray/unix/*.h"
@@ -2330,7 +2334,9 @@ elseif(WINDOWS)
23302334
set(HAVE_RENDER_VULKAN TRUE)
23312335
endif()
23322336
endif()
2337+
endif()
23332338

2339+
if(SDL_TRAY)
23342340
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/tray/windows/*.c")
23352341
set(HAVE_SDL_TRAY TRUE)
23362342
endif()
@@ -2646,11 +2652,11 @@ elseif(APPLE)
26462652
endif()
26472653
endif()
26482654
endif()
2655+
endif()
26492656

2650-
if(MACOS)
2651-
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/tray/cocoa/*.m")
2652-
set(HAVE_SDL_TRAY TRUE)
2653-
endif()
2657+
if(SDL_TRAY AND MACOS)
2658+
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/tray/cocoa/*.m")
2659+
set(HAVE_SDL_TRAY TRUE)
26542660
endif()
26552661

26562662
# Minimum version for $<LINK_LIBRARY:feature,library-list>

VisualC-GDK/SDL/SDL.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,6 @@
889889
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
890890
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
891891
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
892-
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
893892
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
894893
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
895894
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />

VisualC-GDK/SDL/SDL.vcxproj.filters

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@
191191
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
192192
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
193193
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
194-
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
195194
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
196195
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
197196
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />

VisualC/SDL/SDL.vcxproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,6 @@
744744
<ClCompile Include="..\..\src\video\SDL_video_unsupported.c" />
745745
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
746746
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
747-
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c" />
748747
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
749748
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
750749
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
@@ -775,4 +774,4 @@
775774
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
776775
<ImportGroup Label="ExtensionTargets">
777776
</ImportGroup>
778-
</Project>
777+
</Project>

VisualC/SDL/SDL.vcxproj.filters

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,9 +1356,6 @@
13561356
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c">
13571357
<Filter>video\dummy</Filter>
13581358
</ClCompile>
1359-
<ClCompile Include="..\..\src\video\windows\SDL_surface_utils.c">
1360-
<Filter>video\windows</Filter>
1361-
</ClCompile>
13621359
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c">
13631360
<Filter>video\windows</Filter>
13641361
</ClCompile>
@@ -1618,4 +1615,4 @@
16181615
<ItemGroup>
16191616
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
16201617
</ItemGroup>
1621-
</Project>
1618+
</Project>

include/build_config/SDL_build_config.h.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@
540540
/* Enable dialog subsystem */
541541
#cmakedefine SDL_DIALOG_DUMMY 1
542542

543+
/* Enable tray subsystem */
544+
#cmakedefine SDL_TRAY_DUMMY 1
545+
543546
/* Enable assembly routines */
544547
#cmakedefine SDL_ALTIVEC_BLITTERS 1
545548

include/build_config/SDL_build_config_android.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@
208208
#define SDL_CAMERA_DRIVER_ANDROID 1
209209
#endif /* SDL_CAMERA_DISABLED */
210210

211+
/* Enable tray subsystem */
212+
#define SDL_TRAY_DUMMY 1
213+
211214
/* Enable nl_langinfo and high-res file times on version 26 and higher. */
212215
#if __ANDROID_API__ >= 26
213216
#define HAVE_NL_LANGINFO 1

include/build_config/SDL_build_config_ios.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,7 @@
223223
/* Enable dialog subsystem */
224224
#define SDL_DIALOG_DUMMY 1
225225

226+
/* Enable tray subsystem */
227+
#define SDL_TRAY_DUMMY 1
228+
226229
#endif /* SDL_build_config_ios_h_ */

include/build_config/SDL_build_config_minimal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,7 @@ typedef unsigned int uintptr_t;
9898
/* Enable dialog subsystem */
9999
#define SDL_DIALOG_DUMMY 1
100100

101+
/* Enable tray subsystem */
102+
#define SDL_TRAY_DUMMY 1
103+
101104
#endif /* SDL_build_config_minimal_h_ */

include/build_config/SDL_build_config_xbox.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,7 @@
220220
/* Enable dialog subsystem */
221221
#define SDL_DIALOG_DUMMY 1
222222

223+
/* Enable tray subsystem */
224+
#define SDL_TRAY_DUMMY 1
225+
223226
#endif /* SDL_build_config_wingdk_h_ */

0 commit comments

Comments
 (0)