Skip to content

Commit

Permalink
Fix build issues
Browse files Browse the repository at this point in the history
Caused by f53a528
  • Loading branch information
lukas-w committed May 14, 2020
1 parent e52d664 commit c2d530e
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 67 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ IF(WANT_JACK)
IF(JACK_FOUND)
IF(WANT_WEAKJACK)
SET(LMMS_HAVE_WEAKJACK TRUE)
SET(WEAKJACK_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src/3rdparty/weakjack/weakjack)
SET(WEAKJACK_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/src/3rdparty/weakjack/weakjack")
SET(STATUS_JACK "OK (weak linking enabled)")
# use dlsym instead
SET(JACK_LIBRARIES ${CMAKE_DL_LIBS})
Expand Down
2 changes: 1 addition & 1 deletion include/AutomationTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "Track.h"


class AutomationTrack : public Track
class LMMS_EXPORT AutomationTrack : public Track
{
Q_OBJECT
public:
Expand Down
3 changes: 2 additions & 1 deletion include/BBTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
#include <QtCore/QMap>
#include <QStaticText>

#include "lmms_export.h"
#include "Track.h"

class TrackLabelButton;
class TrackContainer;


class BBTCO : public TrackContentObject
class LMMS_EXPORT BBTCO : public TrackContentObject
{
public:
BBTCO( Track * _track );
Expand Down
2 changes: 1 addition & 1 deletion include/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static MemoryManager::MmCounter _mm_counter;
static thread_local MemoryManager::MmCounter _mm_thread_counter;

template<typename T>
class MmAllocator
class LMMS_EXPORT MmAllocator
{
public:
MmAllocator() = default;
Expand Down
5 changes: 3 additions & 2 deletions include/MemoryPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

#include <cstddef>
#include <memory>
#include "lmms_export.h"

class _MemoryPool_Private;
class LMMS_EXPORT _MemoryPool_Private;

class _MemoryPool_Base
class LMMS_EXPORT _MemoryPool_Base
{
public:
_MemoryPool_Base(size_t size, size_t nmemb);
Expand Down
6 changes: 4 additions & 2 deletions include/ModelVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
#ifndef MODELVISITOR_H
#define MODELVISITOR_H

#include "lmms_export.h"

class AutomatableModel;
class BoolModel;
class IntModel;
class FloatModel;
class ComboBoxModel;
class TempoSyncKnobModel;

class ModelVisitor
class LMMS_EXPORT ModelVisitor
{
template<class ParentType = AutomatableModel, class ModelType>
void up(ModelType& m) { visit(static_cast<ParentType&>(m)); }
Expand All @@ -46,7 +48,7 @@ class ModelVisitor
virtual ~ModelVisitor();
};

class ConstModelVisitor
class LMMS_EXPORT ConstModelVisitor
{
template<class ParentType = AutomatableModel, class ModelType>
void up(const ModelType& m) {
Expand Down
3 changes: 2 additions & 1 deletion include/ProjectVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
#define PROJECT_VERSION_H

#include <QtCore/QString>
#include "lmms_export.h"

/*! \brief Version number parsing and comparison
*
* Parses and compares version information. i.e. "1.0.3" < "1.0.10"
*/
class ProjectVersion
class LMMS_EXPORT ProjectVersion
{
public:
enum CompareType { Major, Minor, Release, Stage, Build };
Expand Down
99 changes: 41 additions & 58 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ ADD_SUBDIRECTORY(gui)
ADD_SUBDIRECTORY(tracks)

QT5_WRAP_UI(LMMS_UI_OUT ${LMMS_UIS})
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/include"
"${RINGBUFFER_DIR}/include"
)

IF(WIN32 AND MSVC)
SET(WINRC "${CMAKE_BINARY_DIR}/lmms.rc")
Expand All @@ -49,61 +41,24 @@ ADD_GEN_QRC(LMMS_RCC_OUT lmms.qrc
"${CONTRIBUTORS}"
)

# Paths relative to lmms executable
FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}")
FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE "/${BIN_DIR}" "/${PLUGIN_DIR}")
ADD_DEFINITIONS(-DLIB_DIR="${LIB_DIR_RELATIVE}" -DPLUGIN_DIR="${PLUGIN_DIR_RELATIVE}" ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS})
INCLUDE_DIRECTORIES(
${JACK_INCLUDE_DIRS}
${SAMPLERATE_INCLUDE_DIRS}
${SNDFILE_INCLUDE_DIRS}
${SNDIO_INCLUDE_DIRS}
${FFTW3F_INCLUDE_DIRS}
)

IF(NOT ("${SDL2_INCLUDE_DIR}" STREQUAL ""))
INCLUDE_DIRECTORIES("${SDL2_INCLUDE_DIR}")
ELSEIF(NOT ("${SDL_INCLUDE_DIR}" STREQUAL ""))
INCLUDE_DIRECTORIES("${SDL_INCLUDE_DIR}")
ENDIF()

IF(LMMS_HAVE_WEAKJACK)
LIST(APPEND LMMS_SRCS "${WEAKJACK_INCLUDE_DIRS}/weak_libjack.c")
LIST(APPEND LMMS_INCLUDES "${WEAKJACK_INCLUDE_DIRS}/weak_libjack.h")
INCLUDE_DIRECTORIES("${WEAKJACK_INCLUDE_DIRS}")
ADD_DEFINITIONS(-DUSE_WEAK_JACK=1 -DNO_JACK_METADATA=1)
ENDIF()

IF(NOT ("${PORTAUDIO_INCLUDE_DIR}" STREQUAL ""))
INCLUDE_DIRECTORIES("${PORTAUDIO_INCLUDE_DIR}")
ENDIF()

IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL ""))
INCLUDE_DIRECTORIES("${PULSEAUDIO_INCLUDE_DIR}")
ENDIF()

IF(NOT ("${OGGVORBIS_INCLUDE_DIR}" STREQUAL ""))
INCLUDE_DIRECTORIES("${OGGVORBIS_INCLUDE_DIR}")
ENDIF()

IF(NOT ("${LAME_INCLUDE_DIRS}" STREQUAL ""))
INCLUDE_DIRECTORIES("${LAME_INCLUDE_DIRS}")
ENDIF()

LIST(APPEND LMMS_SRCS "${RINGBUFFER_DIR}/src/lib/ringbuffer.cpp")

# Use libraries in non-standard directories (e.g., another version of Qt)
IF(LMMS_BUILD_LINUX)
LINK_LIBRARIES(-Wl,--enable-new-dtags)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF()
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

message("My waeck jack include dir is ${LMMS_HAVE_WEAKJACK} ${WEAKJACK_INCLUDE_DIR}")
ADD_LIBRARY(lmmslib SHARED
${LMMS_SRCS}
${LMMS_INCLUDES}
${LMMS_UI_OUT}
${LMMS_RCC_OUT}
${RINGBUFFER_DIR}/src/lib/ringbuffer.cpp
$<$<BOOL:${LMMS_HAVE_WEAKJACK}>:
${WEAKJACK_INCLUDE_DIR}/weak_libjack.c
${WEAKJACK_INCLUDE_DIR}/weak_libjack.h
>
)

GENERATE_EXPORT_HEADER(lmmslib
Expand All @@ -114,8 +69,40 @@ ADD_EXECUTABLE(lmms
core/main.cpp
"${WINRC}"
)
TARGET_INCLUDE_DIRECTORIES(lmms
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}

TARGET_INCLUDE_DIRECTORIES(lmmslib PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/include"
"${RINGBUFFER_DIR}/include"
${JACK_INCLUDE_DIRS}
${SAMPLERATE_INCLUDE_DIRS}
${SNDFILE_INCLUDE_DIRS}
${SNDIO_INCLUDE_DIRS}
${FFTW3F_INCLUDE_DIRS}
${SDL2_INCLUDE_DIR}
${SDL_INCLUDE_DIR}
${PORTAUDIO_INCLUDE_DIR}
${PULSEAUDIO_INCLUDE_DIR}
${OGGVORBIS_INCLUDE_DIR}
${LAME_INCLUDE_DIRS}
${WEAKJACK_INCLUDE_DIR}
)


# Paths relative to lmms executable
FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}")
FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE "/${BIN_DIR}" "/${PLUGIN_DIR}")
TARGET_COMPILE_DEFINITIONS(lmmslib
PRIVATE
LIB_DIR="${LIB_DIR_RELATIVE}"
PLUGIN_DIR="${PLUGIN_DIR_RELATIVE}"
PUBLIC
${PULSEAUDIO_DEFINITIONS}
${PORTAUDIO_DEFINITIONS}
$<$<BOOL:${LMMS_HAVE_WEAKJACK}>:USE_WEAK_JACK=1 NO_JACK_METADATA=1>
)

# Set Visual Studio startup project to lmms
Expand All @@ -142,7 +129,7 @@ IF(LMMS_BUILD_HAIKU)
SET(EXTRA_LIBRARIES "-lnetwork")
ENDIF()

SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS}
TARGET_LINK_LIBRARIES(lmmslib
${CMAKE_THREAD_LIBS_INIT}
${QT_LIBRARIES}
${ASOUND_LIBRARY}
Expand All @@ -161,10 +148,6 @@ SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS}
rpmalloc
cds
)

TARGET_LINK_LIBRARIES(lmmslib
${LMMS_REQUIRED_LIBS}
)
TARGET_LINK_LIBRARIES(lmms lmmslib)

IF(NOT LMMS_BUILD_WIN32)
Expand Down

0 comments on commit c2d530e

Please sign in to comment.