CMake: Build system support for FreeBSD

This commit is contained in:
Connor McLaughlin 2021-03-07 18:35:46 +10:00
parent 3f5d6ee025
commit 7190c571f9
4 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(duckstation C CXX)
message("CMake Version: ${CMAKE_VERSION}")
message("CMake System Name: ${CMAKE_SYSTEM_NAME}")
# Pull in modules.
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
@ -11,6 +12,9 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX TRUE)
set(SUPPORTS_X11 TRUE)
set(SUPPORTS_WAYLAND TRUE)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(FREEBSD TRUE)
set(SUPPORTS_X11 TRUE)
endif()
# Set minimum OS version for macOS. 10.14 should work.
@ -34,10 +38,10 @@ endif()
if(SUPPORTS_WAYLAND)
option(USE_WAYLAND "Support Wayland window system" OFF)
endif()
if(LINUX OR ANDROID)
if((LINUX OR FREEBSD) OR ANDROID)
option(USE_EGL "Support EGL OpenGL context creation" ON)
endif()
if(LINUX AND NOT ANDROID)
if((LINUX OR FREEBSD) AND NOT ANDROID)
option(USE_DRMKMS "Support DRM/KMS OpenGL contexts" OFF)
option(USE_FBDEV "Support FBDev OpenGL contexts" OFF)
option(USE_EVDEV "Support EVDev controller interface" ON)

View File

@ -12,6 +12,7 @@ FIND_PATH(
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
/usr/include
/usr/local/include
/usr/local/include/libevdev-1.0
${LIBEVDEV_PATH_INCLUDES}
)

View File

@ -25,7 +25,7 @@ elseif(APPLE)
src/connection_unix.cpp
src/discord_register_osx.m
)
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
elseif(LINUX OR FREEBSD)
target_sources(discord-rpc PRIVATE
src/connection_unix.cpp
src/discord_register_linux.cpp

View File

@ -28,6 +28,7 @@ target_link_libraries(vulkan-loader PRIVATE ${CMAKE_DL_LIBS})
if(USE_X11)
target_compile_definitions(vulkan-loader PUBLIC "VULKAN_USE_X11=1")
target_include_directories(vulkan-loader PUBLIC "${X11_INCLUDE_DIR}")
endif()
if(USE_WAYLAND)