From 732448c3921d9ef2e4297d6670ecfcade42e8572 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 2 Jun 2019 08:18:36 +0100 Subject: [PATCH] FreeBSD build version --- CMakeLists.txt | 4 ++-- cmake/modules/DetectMachine.cmake | 2 ++ include/versioninfo.h | 4 ++++ plugins/zynaddsubfx/CMakeLists.txt | 2 +- src/core/Mixer.cpp | 2 +- src/core/ProjectRenderer.cpp | 2 +- src/core/main.cpp | 2 +- src/gui/PianoView.cpp | 2 +- src/lmmsconfig.h.in | 1 + 9 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 057cfa281b8..5dab2ab13fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -431,9 +431,9 @@ If(WANT_GIG) ENDIF(WANT_GIG) # check for pthreads -IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD) +IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD) FIND_PACKAGE(Threads) -ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD) +ENDIF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD) IF(WANT_SNDIO) FIND_PACKAGE(Sndio) diff --git a/cmake/modules/DetectMachine.cmake b/cmake/modules/DetectMachine.cmake index 60c4a0953ce..c764b5507f1 100644 --- a/cmake/modules/DetectMachine.cmake +++ b/cmake/modules/DetectMachine.cmake @@ -4,6 +4,8 @@ ELSEIF(APPLE) SET(LMMS_BUILD_APPLE 1) ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") SET(LMMS_BUILD_OPENBSD 1) +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + SET(LMMS_BUILD_FREEBSD 1) ELSEIF(HAIKU) SET(LMMS_BUILD_HAIKU 1) ELSE() diff --git a/include/versioninfo.h b/include/versioninfo.h index 8477a61c0d7..664fc80e65c 100644 --- a/include/versioninfo.h +++ b/include/versioninfo.h @@ -28,6 +28,10 @@ #define PLATFORM "OpenBSD" #endif +#ifdef LMMS_BUILD_FREEBSD +#define PLATFORM "FreeBSD" +#endif + #ifdef LMMS_BUILD_WIN32 #define PLATFORM "win32" #endif diff --git a/plugins/zynaddsubfx/CMakeLists.txt b/plugins/zynaddsubfx/CMakeLists.txt index 9d90c5e38d7..4c170a987f0 100644 --- a/plugins/zynaddsubfx/CMakeLists.txt +++ b/plugins/zynaddsubfx/CMakeLists.txt @@ -2,7 +2,7 @@ INCLUDE(BuildPlugin) # definitions for ZynAddSubFX -IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD) +IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD) FIND_PACKAGE(X11) INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) ADD_DEFINITIONS(-DOS_LINUX) diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index ac1aa256455..38ee5c46d6c 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -1242,7 +1242,7 @@ void Mixer::fifoWriter::run() disable_denormals(); #if 0 -#ifdef LMMS_BUILD_LINUX +#if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_FREEBSD) #ifdef LMMS_HAVE_SCHED_H cpu_set_t mask; CPU_ZERO( &mask ); diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 95ed1bd8dc4..edf7a88a3af 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -162,7 +162,7 @@ void ProjectRenderer::run() { MemoryManager::ThreadGuard mmThreadGuard; Q_UNUSED(mmThreadGuard); #if 0 -#ifdef LMMS_BUILD_LINUX +#if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_FREEBSD) #ifdef LMMS_HAVE_SCHED_H cpu_set_t mask; CPU_ZERO( &mask ); diff --git a/src/core/main.cpp b/src/core/main.cpp index cc9cb4f2a73..1f400e91a0a 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -666,7 +666,7 @@ int main( int argc, char * * argv ) // try to set realtime priority -#ifdef LMMS_BUILD_LINUX +#if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_FREEBSD) #ifdef LMMS_HAVE_SCHED_H #ifndef __OpenBSD__ struct sched_param sparam; diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 2a64e72dd64..596a2c21211 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -200,7 +200,7 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) case 27: return 31; // ] } #endif -#if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_OPENBSD) +#if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_OPENBSD) || defined(LMMS_BUILD_FREEBSD) switch( k ) { case 52: return 0; // Z = C diff --git a/src/lmmsconfig.h.in b/src/lmmsconfig.h.in index aa4505dbbcc..7e37be8bd84 100644 --- a/src/lmmsconfig.h.in +++ b/src/lmmsconfig.h.in @@ -3,6 +3,7 @@ #cmakedefine LMMS_BUILD_WIN64 #cmakedefine LMMS_BUILD_APPLE #cmakedefine LMMS_BUILD_OPENBSD +#cmakedefine LMMS_BUILD_FREEBSD #cmakedefine LMMS_BUILD_HAIKU #cmakedefine LMMS_HOST_X86