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)