build: add freebsd support (#4049)

This commit is contained in:
David Lane 2025-11-11 23:46:11 -05:00 committed by GitHub
commit 1d6d916b7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 1055 additions and 39 deletions

View file

@ -1,6 +1,10 @@
# linux specific compile definitions
add_compile_definitions(SUNSHINE_PLATFORM="linux")
if(FREEBSD)
add_compile_definitions(SUNSHINE_PLATFORM="freebsd")
else()
add_compile_definitions(SUNSHINE_PLATFORM="linux")
endif()
# AppImage
if(${SUNSHINE_BUILD_APPIMAGE})
@ -211,6 +215,9 @@ endif()
# These need to be set before adding the inputtino subdirectory in order for them to be picked up
set(LIBEVDEV_CUSTOM_INCLUDE_DIR "${EVDEV_INCLUDE_DIR}")
set(LIBEVDEV_CUSTOM_LIBRARY "${EVDEV_LIBRARY}")
if(FREEBSD)
set(USE_UHID OFF)
endif()
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/inputtino")
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES inputtino::libinputtino)