CMake: Build system support for FreeBSD
This commit is contained in:
parent
3f5d6ee025
commit
7190c571f9
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.10)
|
||||||
project(duckstation C CXX)
|
project(duckstation C CXX)
|
||||||
|
|
||||||
message("CMake Version: ${CMAKE_VERSION}")
|
message("CMake Version: ${CMAKE_VERSION}")
|
||||||
|
message("CMake System Name: ${CMAKE_SYSTEM_NAME}")
|
||||||
|
|
||||||
# Pull in modules.
|
# Pull in modules.
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
|
||||||
|
@ -11,6 +12,9 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||||
set(LINUX TRUE)
|
set(LINUX TRUE)
|
||||||
set(SUPPORTS_X11 TRUE)
|
set(SUPPORTS_X11 TRUE)
|
||||||
set(SUPPORTS_WAYLAND TRUE)
|
set(SUPPORTS_WAYLAND TRUE)
|
||||||
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||||
|
set(FREEBSD TRUE)
|
||||||
|
set(SUPPORTS_X11 TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set minimum OS version for macOS. 10.14 should work.
|
# Set minimum OS version for macOS. 10.14 should work.
|
||||||
|
@ -34,10 +38,10 @@ endif()
|
||||||
if(SUPPORTS_WAYLAND)
|
if(SUPPORTS_WAYLAND)
|
||||||
option(USE_WAYLAND "Support Wayland window system" OFF)
|
option(USE_WAYLAND "Support Wayland window system" OFF)
|
||||||
endif()
|
endif()
|
||||||
if(LINUX OR ANDROID)
|
if((LINUX OR FREEBSD) OR ANDROID)
|
||||||
option(USE_EGL "Support EGL OpenGL context creation" ON)
|
option(USE_EGL "Support EGL OpenGL context creation" ON)
|
||||||
endif()
|
endif()
|
||||||
if(LINUX AND NOT ANDROID)
|
if((LINUX OR FREEBSD) AND NOT ANDROID)
|
||||||
option(USE_DRMKMS "Support DRM/KMS OpenGL contexts" OFF)
|
option(USE_DRMKMS "Support DRM/KMS OpenGL contexts" OFF)
|
||||||
option(USE_FBDEV "Support FBDev OpenGL contexts" OFF)
|
option(USE_FBDEV "Support FBDev OpenGL contexts" OFF)
|
||||||
option(USE_EVDEV "Support EVDev controller interface" ON)
|
option(USE_EVDEV "Support EVDev controller interface" ON)
|
||||||
|
|
|
@ -12,6 +12,7 @@ FIND_PATH(
|
||||||
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
|
HINTS ${PC_LIBEVDEV_INCLUDEDIR} ${PC_LIBEVDEV_INCLUDE_DIRS}
|
||||||
/usr/include
|
/usr/include
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
|
/usr/local/include/libevdev-1.0
|
||||||
${LIBEVDEV_PATH_INCLUDES}
|
${LIBEVDEV_PATH_INCLUDES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ elseif(APPLE)
|
||||||
src/connection_unix.cpp
|
src/connection_unix.cpp
|
||||||
src/discord_register_osx.m
|
src/discord_register_osx.m
|
||||||
)
|
)
|
||||||
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
|
elseif(LINUX OR FREEBSD)
|
||||||
target_sources(discord-rpc PRIVATE
|
target_sources(discord-rpc PRIVATE
|
||||||
src/connection_unix.cpp
|
src/connection_unix.cpp
|
||||||
src/discord_register_linux.cpp
|
src/discord_register_linux.cpp
|
||||||
|
|
|
@ -28,6 +28,7 @@ target_link_libraries(vulkan-loader PRIVATE ${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
if(USE_X11)
|
if(USE_X11)
|
||||||
target_compile_definitions(vulkan-loader PUBLIC "VULKAN_USE_X11=1")
|
target_compile_definitions(vulkan-loader PUBLIC "VULKAN_USE_X11=1")
|
||||||
|
target_include_directories(vulkan-loader PUBLIC "${X11_INCLUDE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_WAYLAND)
|
if(USE_WAYLAND)
|
||||||
|
|
Loading…
Reference in New Issue