From df154af82348aa5bb8f5abd0a1450018e3ef2308 Mon Sep 17 00:00:00 2001 From: Daniel Wilkins Date: Thu, 30 Sep 2021 17:34:04 -0400 Subject: [PATCH] Fix on OpenBSD --- src/CMakeLists.txt | 8 +++++++- src/drivers/Qt/ConsoleWindow.cpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b509c40..5553da1d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -132,7 +132,13 @@ else(WIN32) set( OPENGL_LDFLAGS "-framework OpenGL" ) else() set( OPENGL_LDFLAGS ${OPENGL_LIBRARIES} ) - set( SYS_LIBS -lrt -lpthread -ldl) + # OpenBSD refuses to implement the POSIX realtime interface and + # refuses to provide a stub library for -ldl + if(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") + set( SYS_LIBS -lpthread) + else() + set( SYS_LIBS -lrt -lpthread -ldl) + endif() endif() endif(WIN32) diff --git a/src/drivers/Qt/ConsoleWindow.cpp b/src/drivers/Qt/ConsoleWindow.cpp index 3545168e..e89d0094 100644 --- a/src/drivers/Qt/ConsoleWindow.cpp +++ b/src/drivers/Qt/ConsoleWindow.cpp @@ -4086,7 +4086,7 @@ int consoleWin_t::getSchedParam( int &policy, int &priority ) { int ret = 0; -#if defined(__linux__) || defined(__unix__) +#if defined(__linux__) || defined(__unix__) && !defined(__OpenBSD__) struct sched_param p; policy = sched_getscheduler( getpid() ); @@ -4122,7 +4122,7 @@ int consoleWin_t::getSchedParam( int &policy, int &priority ) int consoleWin_t::setSchedParam( int policy, int priority ) { int ret = 0; -#if defined(__linux__) || defined(__unix__) +#if defined(__linux__) || defined(__unix__) && !defined(__OpenBSD__) struct sched_param p; int minPrio, maxPrio;