Skip to content

Commit

Permalink
Add Windows JACK support (LMMS#5716)
Browse files Browse the repository at this point in the history
Add Windows JACK support
Also adds JACK as a submodule
  • Loading branch information
tresf authored Oct 30, 2020
1 parent 2d51eae commit dc78b15
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@
[submodule "plugins/sid/resid"]
path = plugins/Sid/resid
url = https://github.com/simonowen/resid
[submodule "src/3rdparty/jack2"]
path = src/3rdparty/jack2
url = https://github.com/jackaudio/jack2
37 changes: 21 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0057 NEW)
ENDIF(COMMAND CMAKE_POLICY)


# Import of windows.h breaks min()/max()
ADD_DEFINITIONS(-DNOMINMAX)

INCLUDE(PluginList)
INCLUDE(CheckSubmodules)
INCLUDE(AddFileDependencies)
Expand Down Expand Up @@ -97,15 +101,13 @@ ENDIF(LMMS_BUILD_APPLE)

IF(LMMS_BUILD_WIN32)
SET(WANT_ALSA OFF)
SET(WANT_JACK OFF)
SET(WANT_PULSEAUDIO OFF)
SET(WANT_SNDIO OFF)
SET(WANT_SOUNDIO OFF)
SET(WANT_WINMM ON)
SET(BUNDLE_QT_TRANSLATIONS ON)
SET(LMMS_HAVE_WINMM TRUE)
SET(STATUS_ALSA "<not supported on this platform>")
SET(STATUS_JACK "<not supported on this platform>")
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
SET(STATUS_SOUNDIO "<disabled in this release>")
SET(STATUS_WINMM "OK")
Expand Down Expand Up @@ -433,23 +435,26 @@ ENDIF(NOT LMMS_HAVE_ALSA)

# check for JACK
IF(WANT_JACK)
PKG_CHECK_MODULES(JACK jack>=0.77)
IF(JACK_FOUND)
IF(WANT_WEAKJACK)
SET(LMMS_HAVE_WEAKJACK TRUE)
SET(WEAKJACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/weakjack/weakjack)
SET(STATUS_JACK "OK (weak linking enabled)")
# use dlsym instead
SET(JACK_LIBRARIES ${CMAKE_DL_LIBS})
ELSE()
IF(WANT_WEAKJACK)
SET(LMMS_HAVE_WEAKJACK TRUE)
SET(WEAKJACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/weakjack/weakjack)
SET(JACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/jack2/common)
SET(STATUS_JACK "OK (weak linking enabled)")
# use dlsym instead
SET(JACK_LIBRARIES ${CMAKE_DL_LIBS})
SET(LMMS_HAVE_JACK TRUE)
SET(JACK_FOUND TRUE)
ELSE()
PKG_CHECK_MODULES(JACK jack>=0.77)
IF(JACK_FOUND)
SET(STATUS_JACK "OK")
ENDIF()
SET(LMMS_HAVE_JACK TRUE)
ELSE(JACK_FOUND)
ENDIF()

IF(NOT JACK_FOUND)
SET(JACK_INCLUDE_DIRS "")
SET(STATUS_JACK "not found, please install libjack0.100.0-dev (or similar) "
"if you require JACK support")
ENDIF(JACK_FOUND)
SET(STATUS_JACK "not found")
ENDIF()
ENDIF(WANT_JACK)

# check for FFTW3F-library
Expand Down
4 changes: 0 additions & 4 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
#include <QDomDocument>

#ifdef LMMS_BUILD_WIN32
# ifndef NOMINMAX
# define NOMINMAX
# endif

# include <windows.h>
# include <QLayout>
#endif
Expand Down
1 change: 1 addition & 0 deletions src/3rdparty/jack2
Submodule jack2 added at db76dd
2 changes: 1 addition & 1 deletion src/3rdparty/weakjack/weakjack
3 changes: 0 additions & 3 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
#include <QTextStream>

#ifdef LMMS_BUILD_WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif

Expand Down

0 comments on commit dc78b15

Please sign in to comment.