Skip to content

Commit

Permalink
include no SDL headers if no headless build
Browse files Browse the repository at this point in the history
  • Loading branch information
Rabbidon committed Jan 12, 2023
1 parent b33b8ec commit 0a9a351
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions =3.6.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Collecting protobuf
Using cached protobuf-4.21.12-cp37-abi3-manylinux2014_x86_64.whl (409 kB)
Installing collected packages: protobuf
Successfully installed protobuf-4.21.12
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
# Set some random things default to not being visible in the GUI
mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)

if(BUILD_CLIENT AND BUILD_HEADLESS)
find_package(SDL2 REQUIRED)
endif()

if(NOT (BUILD_CLIENT OR BUILD_SERVER))
message(WARNING "Neither BUILD_CLIENT nor BUILD_SERVER is set! Setting BUILD_SERVER=true")
Expand Down Expand Up @@ -64,7 +67,6 @@ if(NOT USE_CURL)
endif()
endif()


option(ENABLE_GETTEXT "Use GetText for internationalization" ${BUILD_CLIENT})
set(USE_GETTEXT FALSE)

Expand Down Expand Up @@ -567,6 +569,7 @@ if(BUILD_CLIENT)
${PROJECT_NAME}
${ZLIB_LIBRARIES}
IrrlichtMt::IrrlichtMt
$<$<BOOL:BUILD_HEADLESS>:SDL2::SDL2>
${ZSTD_LIBRARY}
${ZMQ_LIBRARY}
${ZMQPP_LIBRARY}
Expand Down
4 changes: 3 additions & 1 deletion src/client/renderingengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "inputhandler.h"
#include "gettext.h"
#include "../gui/guiSkin.h"
#include <SDL_video.h>
#ifdef BUILD_HEADLESS
#include <SDL_video.h>
#endif

#if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__) && \
!defined(SERVER) && !defined(__HAIKU__)
Expand Down

0 comments on commit 0a9a351

Please sign in to comment.