Suppress warnings in third-party code (#7319)
This commit is contained in:
@@ -15,8 +15,7 @@ function(enable_policy_if_exists id)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Needed for the SWH Ladspa plugins. See below.
|
||||
enable_policy_if_exists(CMP0074) # find_package() uses <PackageName>_ROOT variables.
|
||||
enable_policy_if_exists(CMP0092) # MSVC warning flags are not in CMAKE_<LANG>_FLAGS by default.
|
||||
# Needed for ccache support with MSVC
|
||||
enable_policy_if_exists(CMP0141) # MSVC debug information format flags are selected by an abstraction.
|
||||
|
||||
@@ -43,6 +42,7 @@ INCLUDE(AddFileDependencies)
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
INCLUDE(FindPkgConfig)
|
||||
INCLUDE(GenerateExportHeader)
|
||||
include(StaticDependencies)
|
||||
|
||||
STRING(TOUPPER "${CMAKE_PROJECT_NAME}" PROJECT_NAME_UCASE)
|
||||
|
||||
@@ -172,7 +172,7 @@ LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
|
||||
FIND_PACKAGE(Qt5 5.9.0 COMPONENTS Core Gui Widgets Xml REQUIRED)
|
||||
FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
include_directories(SYSTEM
|
||||
${Qt5Core_INCLUDE_DIRS}
|
||||
${Qt5Gui_INCLUDE_DIRS}
|
||||
${Qt5Widgets_INCLUDE_DIRS}
|
||||
@@ -410,7 +410,7 @@ IF(WANT_SOUNDIO)
|
||||
IF(SOUNDIO_FOUND)
|
||||
SET(LMMS_HAVE_SOUNDIO TRUE)
|
||||
SET(STATUS_SOUNDIO "OK")
|
||||
INCLUDE_DIRECTORIES("${SOUNDIO_INCLUDE_DIR}")
|
||||
include_directories(SYSTEM "${SOUNDIO_INCLUDE_DIR}")
|
||||
ELSE(SOUNDIO_FOUND)
|
||||
SET(SOUNDIO_INCLUDE_DIR "")
|
||||
SET(STATUS_SOUNDIO "not found, please install libsoundio if you require libsoundio support")
|
||||
@@ -491,11 +491,9 @@ ENDIF(NOT LMMS_HAVE_ALSA)
|
||||
IF(WANT_JACK)
|
||||
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(JACK_INCLUDE_DIRS "")
|
||||
set(JACK_LIBRARIES weakjack)
|
||||
SET(LMMS_HAVE_JACK TRUE)
|
||||
SET(LMMS_HAVE_JACK_PRENAME TRUE)
|
||||
SET(JACK_FOUND TRUE)
|
||||
@@ -631,28 +629,63 @@ ENDIF(WANT_DEBUG_FPE)
|
||||
# check for libsamplerate
|
||||
FIND_PACKAGE(Samplerate 0.1.8 MODULE REQUIRED)
|
||||
|
||||
# set compiler flags
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
SET(WERROR_FLAGS "-Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow")
|
||||
OPTION(USE_WERROR "Add -werror to the build flags. Stops the build on warnings" OFF)
|
||||
IF(${USE_WERROR})
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} -Werror")
|
||||
ENDIF()
|
||||
# Shim the SYSTEM property for older CMake versions
|
||||
if(CMAKE_VERSION VERSION_LESS "3.25")
|
||||
define_property(TARGET
|
||||
PROPERTY SYSTEM
|
||||
INHERITED
|
||||
BRIEF_DOCS "Shim of built-in SYSTEM property for CMake versions less than 3.25"
|
||||
FULL_DOCS "Non-functional, but allows the property to be inherited properly."
|
||||
"See the CMake documentation at https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html."
|
||||
)
|
||||
endif()
|
||||
|
||||
# Add warning and error flags
|
||||
option(USE_WERROR "Treat compiler warnings as errors" OFF)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
set(COMPILE_ERROR_FLAGS
|
||||
"-Wall" # Enable most warnings by default
|
||||
"-Werror=unused-function" # Unused functions are an error
|
||||
# TODO: Fix the code and remove the following:
|
||||
"-Wno-sign-compare" # Permit comparisons between signed and unsigned integers
|
||||
"-Wno-strict-overflow" # Permit optimisations assuming no signed overflow
|
||||
)
|
||||
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
|
||||
"-w" # Disable all warnings
|
||||
)
|
||||
|
||||
# Due to a regression in gcc-4.8.X, we need to disable array-bounds check
|
||||
IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0") OR LMMS_BUILD_WIN32))
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds -Wno-attributes")
|
||||
ENDIF()
|
||||
ELSEIF(MSVC)
|
||||
# Remove any existing /W flags
|
||||
string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||
STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
SET(WERROR_FLAGS "/W2")
|
||||
IF(${USE_WERROR})
|
||||
SET(WERROR_FLAGS "${WERROR_FLAGS} /WX")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# TODO: Is this still necessary?
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
"-Wno-array-bounds" # Permit out-of-bounds array subscripts
|
||||
"-Wno-attributes" # Permit unrecognised attributes
|
||||
)
|
||||
endif()
|
||||
|
||||
if(USE_WERROR)
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
"-Werror" # Treat warnings as errors
|
||||
)
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
set(COMPILE_ERROR_FLAGS
|
||||
"/W2" # Enable some warnings by default
|
||||
"/external:W0" # Don't emit warnings for third-party code
|
||||
"/external:anglebrackets" # Consider headers included with angle brackets to be third-party
|
||||
"/external:templates-" # Still emit warnings from first-party instantiations of third-party templates
|
||||
)
|
||||
set(THIRD_PARTY_COMPILE_ERROR_FLAGS
|
||||
"/W0" # Disable all warnings
|
||||
)
|
||||
|
||||
if(USE_WERROR)
|
||||
list(APPEND COMPILE_ERROR_FLAGS
|
||||
"/WX" # Treat warnings as errors
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
add_compile_options("$<IF:$<BOOL:$<TARGET_PROPERTY:SYSTEM>>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>")
|
||||
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
message(STATUS "Setting build type to 'Release' as none was specified.")
|
||||
@@ -662,8 +695,6 @@ IF(NOT CMAKE_BUILD_TYPE)
|
||||
"MinSizeRel" "RelWithDebInfo")
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_C_FLAGS "${WERROR_FLAGS} ${CMAKE_C_FLAGS}")
|
||||
SET(CMAKE_CXX_FLAGS "${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLMMS_DEBUG")
|
||||
|
||||
@@ -705,12 +736,9 @@ ENDIF()
|
||||
# we somehow have to make LMMS-binary depend on MOC-files
|
||||
ADD_FILE_DEPENDENCIES("${CMAKE_BINARY_DIR}/lmmsconfig.h")
|
||||
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
IF(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
|
||||
ENDIF(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" AND NOT WIN32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -DPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
|
||||
elseif(MSVC)
|
||||
# Use UTF-8 as the source and execution character set
|
||||
add_compile_options("/utf-8")
|
||||
|
||||
141
cmake/modules/StaticDependencies.cmake
Normal file
141
cmake/modules/StaticDependencies.cmake
Normal file
@@ -0,0 +1,141 @@
|
||||
# StaticDependencies.cmake - adds features similar to interface properties that
|
||||
# are only transitive over static dependencies.
|
||||
#
|
||||
# Copyright (c) 2024 Dominic Clark
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
define_property(TARGET
|
||||
PROPERTY STATIC_COMPILE_DEFINITIONS
|
||||
BRIEF_DOCS "Compile definitions to be used by targets linking statically to this one"
|
||||
FULL_DOCS "Behaves similarly to INTERFACE_COMPILE_DEFINITIONS, but only over static dependencies."
|
||||
"Effectively becomes private once an executable module is reached."
|
||||
)
|
||||
|
||||
define_property(TARGET
|
||||
PROPERTY STATIC_LINK_LIBRARIES
|
||||
BRIEF_DOCS "Link libraries to be included in targets linking statically to this one"
|
||||
FULL_DOCS "Behaves similarly to INTERFACE_LINK_LIBRARIES, but only over static dependencies."
|
||||
"Effectively becomes private once an executable module is reached."
|
||||
)
|
||||
|
||||
# Link a target statically to a set of libraries. Forward the given arguments to
|
||||
# `target_link_libraries`, but also perform two additional functions. Firstly,
|
||||
# ensure that the given libraries will be linked into any module that also
|
||||
# links the given target (allowing, for example, object libraries and private
|
||||
# static libraries to be used transitively). Secondly, add any static compile
|
||||
# definitions from the given libraries to the set of compile definitions used
|
||||
# to build the given target.
|
||||
#
|
||||
# This function must be used in order for static requirements as defined in this
|
||||
# module to be inherited transitively. Using `target_link_libraries` instead
|
||||
# will break the chain for static link libraries and static compile definitions.
|
||||
#
|
||||
# Usage:
|
||||
# target_static_libraries(
|
||||
# <target> # The target to which to add the libraries
|
||||
# [<PRIVATE|PUBLIC|INTERFACE>] # Optionally, the scope to use for the following libraries
|
||||
# <item>... # The libraries to which to link
|
||||
# [<PRIVATE|PUBLIC|INTERFACE> <item>...]...
|
||||
# )
|
||||
function(target_static_libraries target)
|
||||
# Target types that have a link step
|
||||
set(linked_target_types "MODULE_LIBRARY" "SHARED_LIBRARY" "EXECUTABLE")
|
||||
# Possible scopes for dependencies
|
||||
set(scopes "PRIVATE" "PUBLIC" "INTERFACE")
|
||||
|
||||
get_target_property(target_type "${target}" TYPE)
|
||||
set(scope "")
|
||||
|
||||
# Iterate over the dependencies (and possibly scopes) that we were given
|
||||
foreach(dependency IN LISTS ARGN)
|
||||
# If we have a scope, store it so we can apply it to upcoming libraries
|
||||
if(dependency IN_LIST scopes)
|
||||
set(scope "${dependency}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# Link the target to the current dependency. (Note: `${scope}` is
|
||||
# unquoted so that the argument disappears if no scope was given.)
|
||||
target_link_libraries("${target}" ${scope} "${dependency}")
|
||||
|
||||
# Store the dependency so it can be linked in with this target later
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_LINK_LIBRARIES
|
||||
"${dependency}"
|
||||
)
|
||||
|
||||
# If the dependency is a target, it may have some of our custom
|
||||
# properties defined on it, so we have a bit more work to do
|
||||
if(TARGET "${dependency}")
|
||||
# Ensure it makes sense to link statically to this dependency
|
||||
get_target_property(dependency_type "${dependency}" TYPE)
|
||||
if(dependency_type IN_LIST linked_target_types)
|
||||
message(SEND_ERROR "Cannot link statically to shared module ${dependency}")
|
||||
endif()
|
||||
|
||||
# Transitively include static definitions and libraries
|
||||
set(defs "$<TARGET_GENEX_EVAL:${dependency},$<TARGET_PROPERTY:${dependency},STATIC_COMPILE_DEFINITIONS>>")
|
||||
set(libs "$<TARGET_GENEX_EVAL:${dependency},$<TARGET_PROPERTY:${dependency},STATIC_LINK_LIBRARIES>>")
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_COMPILE_DEFINITIONS
|
||||
"${defs}"
|
||||
)
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_LINK_LIBRARIES
|
||||
"${libs}"
|
||||
)
|
||||
|
||||
# Add the dependency's transitive static compile definitions.
|
||||
# (Note: definitions are private so dynamically linked dependents
|
||||
# won't pick them up; a static dependent will have them set when
|
||||
# this function is called for it.)
|
||||
target_compile_definitions("${target}" PRIVATE "${defs}")
|
||||
|
||||
# If the target has a link step, add the transitive static
|
||||
# dependencies. (Note: we use `LINK_ONLY` so the caller can still
|
||||
# control usage requirements through the normal use of scopes. Only
|
||||
# transitive dependencies are needed here: the direct dependency was
|
||||
# added earlier on. We have to append to `LINK_LIBRARIES` directly,
|
||||
# rather than use `target_link_libraries(PRIVATE)`, in order to
|
||||
# remain compatible with the scopeless signature of that command.)
|
||||
if(target_type IN_LIST linked_target_types)
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY LINK_LIBRARIES
|
||||
"$<LINK_ONLY:${libs}>"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Add compile definitions to a target only for use with dependents linking
|
||||
# statically to it.
|
||||
#
|
||||
# Behaves like `target_compile_definitions(INTERFACE)`, except the definitions
|
||||
# will not be inherited beyond any executable module into which the target is
|
||||
# actually linked. The definitions are added to the `STATIC_COMPILE_DEFINITIONS`
|
||||
# property on the target.
|
||||
#
|
||||
# Usage:
|
||||
# target_static_definitions(
|
||||
# <target> # The target to which to add the definitions
|
||||
# <definition>... # The definitions to add to the target
|
||||
# )
|
||||
function(target_static_definitions target)
|
||||
set_property(
|
||||
TARGET "${target}"
|
||||
APPEND
|
||||
PROPERTY STATIC_COMPILE_DEFINITIONS
|
||||
"${ARGN}"
|
||||
)
|
||||
endfunction()
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifndef LMMS_HAVE_WEAKJACK
|
||||
#include <jack/jack.h>
|
||||
#else
|
||||
#include "weak_libjack.h"
|
||||
#include <weak_libjack.h>
|
||||
#endif
|
||||
|
||||
#include <atomic>
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
#include <QMutex>
|
||||
#include <QWaitCondition>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h"
|
||||
#include <ringbuffer/ringbuffer.h>
|
||||
|
||||
#include "lmms_basics.h"
|
||||
|
||||
namespace lmms
|
||||
{
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include <ringbuffer/ringbuffer.h>
|
||||
|
||||
#include "LinkedModelGroups.h"
|
||||
#include "LmmsSemaphore.h"
|
||||
#include "Lv2Basics.h"
|
||||
@@ -40,7 +42,6 @@
|
||||
#include "Lv2Options.h"
|
||||
#include "Lv2Worker.h"
|
||||
#include "Plugin.h"
|
||||
#include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h"
|
||||
#include "TimePos.h"
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <jack/jack.h>
|
||||
#include <jack/midiport.h>
|
||||
#else
|
||||
#include "weak_libjack.h"
|
||||
#include <weak_libjack.h>
|
||||
#endif
|
||||
|
||||
#include <QThread>
|
||||
|
||||
@@ -15,7 +15,7 @@ if(LMMS_HAVE_WEAKCARLA)
|
||||
SET(CARLA_NATIVE_LIB carla_native-plugin)
|
||||
|
||||
ADD_LIBRARY(${CARLA_NATIVE_LIB} SHARED DummyCarla.cpp)
|
||||
TARGET_INCLUDE_DIRECTORIES(${CARLA_NATIVE_LIB} PUBLIC ${CARLA_INCLUDE_DIRS})
|
||||
target_include_directories(${CARLA_NATIVE_LIB} SYSTEM PUBLIC ${CARLA_INCLUDE_DIRS})
|
||||
INSTALL(TARGETS ${CARLA_NATIVE_LIB}
|
||||
LIBRARY DESTINATION "${PLUGIN_DIR}/optional"
|
||||
RUNTIME DESTINATION "${PLUGIN_DIR}/optional"
|
||||
@@ -31,7 +31,7 @@ if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA)
|
||||
SET(CARLA_INCLUDE_DIRS ${CARLA_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${CARLA_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${CARLA_LIBRARIES})
|
||||
BUILD_PLUGIN(carlabase Carla.cpp Carla.h
|
||||
|
||||
@@ -37,13 +37,13 @@
|
||||
|
||||
// carla/source/includes
|
||||
#include "carlabase_export.h"
|
||||
#include "CarlaDefines.h"
|
||||
#include <CarlaDefines.h>
|
||||
#if CARLA_VERSION_HEX >= 0x010911
|
||||
#include "CarlaNativePlugin.h"
|
||||
#include <CarlaNativePlugin.h>
|
||||
#else
|
||||
#include "CarlaBackend.h"
|
||||
#include "CarlaNative.h"
|
||||
#include "CarlaUtils.h"
|
||||
#include <CarlaBackend.h>
|
||||
#include <CarlaNative.h>
|
||||
#include <CarlaUtils.h>
|
||||
CARLA_EXPORT
|
||||
const NativePluginDescriptor* carla_get_native_patchbay_plugin();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// A dummy Carla interface
|
||||
#define BUILDING_CARLA
|
||||
#include "CarlaNativePlugin.h"
|
||||
#include <CarlaNativePlugin.h>
|
||||
|
||||
#ifndef CARLA_PLUGIN_EXPORT
|
||||
#define CARLA_PLUGIN_EXPORT CARLA_EXPORT
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA)
|
||||
ADD_DEFINITIONS(-DCARLA_PLUGIN_PATCHBAY -DCARLA_PLUGIN_SYNTH)
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase")
|
||||
include_directories(SYSTEM ${CARLA_INCLUDE_DIRS})
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../CarlaBase"
|
||||
${CARLA_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(carlabase)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA)
|
||||
ADD_DEFINITIONS(-DCARLA_PLUGIN_RACK -DCARLA_PLUGIN_SYNTH)
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase")
|
||||
include_directories(SYSTEM ${CARLA_INCLUDE_DIRS})
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../CarlaBase")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/../CarlaBase"
|
||||
${CARLA_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(carlabase)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS})
|
||||
LINK_LIBRARIES(${FFTW3F_LIBRARIES})
|
||||
BUILD_PLUGIN(eq EqEffect.cpp EqCurve.cpp EqCurve.h EqControls.cpp EqControlsDialog.cpp EqFilter.h EqParameterWidget.cpp EqFader.h EqSpectrumView.h EqSpectrumView.cpp
|
||||
MOCFILES EqControls.h EqControlsDialog.h EqCurve.h EqParameterWidget.h EqFader.h EqSpectrumView.h EMBEDDED_RESOURCES *.png)
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(game-music-emu/gme)
|
||||
include(BuildPlugin)
|
||||
|
||||
BUILD_PLUGIN(freeboy
|
||||
add_library(gme STATIC
|
||||
game-music-emu/gme/Gb_Apu.cpp
|
||||
game-music-emu/gme/Gb_Oscs.cpp
|
||||
game-music-emu/gme/Blip_Buffer.cpp
|
||||
game-music-emu/gme/Multi_Buffer.cpp
|
||||
)
|
||||
target_include_directories(gme PUBLIC game-music-emu/gme)
|
||||
set_target_properties(gme PROPERTIES SYSTEM TRUE)
|
||||
|
||||
build_plugin(freeboy
|
||||
FreeBoy.cpp
|
||||
FreeBoy.h
|
||||
GbApuWrapper.cpp
|
||||
GbApuWrapper.h
|
||||
game-music-emu/gme/Gb_Apu.cpp
|
||||
game-music-emu/gme/Gb_Apu.h
|
||||
game-music-emu/gme/Gb_Oscs.cpp
|
||||
game-music-emu/gme/Blip_Buffer.cpp
|
||||
game-music-emu/gme/Gb_Oscs.h
|
||||
game-music-emu/gme/blargg_common.h
|
||||
game-music-emu/gme/Blip_Buffer.h
|
||||
game-music-emu/gme/Multi_Buffer.cpp
|
||||
game-music-emu/gme/blargg_source.h
|
||||
game-music-emu/gme/Multi_Buffer.h
|
||||
MOCFILES FreeBoy.h
|
||||
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
|
||||
)
|
||||
target_link_libraries(freeboy gme)
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
#ifndef LMMS_FREEBOY_H
|
||||
#define LMMS_FREEBOY_H
|
||||
|
||||
#include <Blip_Buffer.h>
|
||||
|
||||
#include "AutomatableModel.h"
|
||||
#include "Blip_Buffer.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentView.h"
|
||||
#include "Graph.h"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#ifndef LMMS_GB_APU_WRAPPER_H
|
||||
#define LMMS_GB_APU_WRAPPER_H
|
||||
|
||||
#include "Gb_Apu.h"
|
||||
#include "Multi_Buffer.h"
|
||||
#include <Gb_Apu.h>
|
||||
#include <Multi_Buffer.h>
|
||||
|
||||
namespace lmms
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
if(LMMS_HAVE_GIG)
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${GIG_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${GIG_INCLUDE_DIRS})
|
||||
SET(CMAKE_AUTOUIC ON)
|
||||
|
||||
# Required for not crashing loading files with libgig
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Note:
|
||||
# The last version of Calf that was LADSPA-capable is version 0.0.18.2
|
||||
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
# Parse version info from autoconf
|
||||
FILE(READ veal/configure.ac VERSION_FILE)
|
||||
STRING(REPLACE "[" ";" VERSION_FILE ${VERSION_FILE} )
|
||||
@@ -35,16 +37,12 @@ SET_TARGET_PROPERTIES(veal PROPERTIES PREFIX "")
|
||||
TARGET_COMPILE_DEFINITIONS(veal PRIVATE DISABLE_OSC=1)
|
||||
|
||||
SET(INLINE_FLAGS "")
|
||||
SET(OTHER_FLAGS "")
|
||||
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
SET(INLINE_FLAGS -finline-functions-called-once -finline-limit=80)
|
||||
SET(OTHER_FLAGS -Wno-format-overflow)
|
||||
ENDIF()
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(veal PRIVATE /wd4099 /wd4244 /wd4305)
|
||||
else()
|
||||
target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS} ${OTHER_FLAGS})
|
||||
if(NOT MSVC)
|
||||
target_compile_options(veal PRIVATE -fexceptions -O2 -finline-functions ${INLINE_FLAGS})
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
|
||||
FILE(GLOB SOURCES *.cc)
|
||||
LIST(SORT SOURCES)
|
||||
@@ -8,10 +10,8 @@ ADD_DEFINITIONS(-DLMMS_BUILD_WIN64)
|
||||
ENDIF(LMMS_BUILD_WIN64)
|
||||
SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "")
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(caps PRIVATE /wd4244 /wd4305)
|
||||
else()
|
||||
target_compile_options(caps PRIVATE -O2 -funroll-loops -Wno-write-strings)
|
||||
if(NOT MSVC)
|
||||
target_compile_options(caps PRIVATE -O2 -funroll-loops)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
|
||||
FILE(GLOB_RECURSE SOURCES cmt/src/*.cpp)
|
||||
LIST(SORT SOURCES)
|
||||
@@ -6,10 +8,8 @@ INSTALL(TARGETS cmt LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")
|
||||
|
||||
SET_TARGET_PROPERTIES(cmt PROPERTIES PREFIX "")
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(cmt PRIVATE /wd4244 /wd4305)
|
||||
else()
|
||||
target_compile_options(cmt PRIVATE -Wall -O3 -fno-strict-aliasing)
|
||||
if(NOT MSVC)
|
||||
target_compile_options(cmt PRIVATE -O3 -fno-strict-aliasing)
|
||||
endif()
|
||||
|
||||
if(LMMS_BUILD_WIN32)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
# Create blank config.h
|
||||
FILE(WRITE ladspa/config.h "")
|
||||
|
||||
@@ -9,10 +11,8 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
# Additional compile flags
|
||||
if(MSVC)
|
||||
set(COMPILE_FLAGS ${COMPILE_FLAGS} /wd4244 /wd4273 /wd4305)
|
||||
else()
|
||||
set(COMPILE_FLAGS ${COMPILE_FLAGS} -O3 -Wall -c
|
||||
if(NOT MSVC)
|
||||
set(COMPILE_FLAGS ${COMPILE_FLAGS} -O3 -c
|
||||
-fomit-frame-pointer -funroll-loops -ffast-math -fno-strict-aliasing
|
||||
${PIC_FLAGS}
|
||||
)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
|
||||
FILE(GLOB PLUGIN_SOURCES tap-plugins/*.c)
|
||||
LIST(SORT PLUGIN_SOURCES)
|
||||
if(MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4244 /fp:fast")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wno-write-strings -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -fomit-frame-pointer -fno-strict-aliasing -funroll-loops -ffast-math")
|
||||
endif()
|
||||
FOREACH(_item ${PLUGIN_SOURCES})
|
||||
GET_FILENAME_COMPONENT(_plugin "${_item}" NAME_WE)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
IF(LMMS_HAVE_LV2)
|
||||
INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${LILV_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${SUIL_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${LV2_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${LILV_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${SUIL_INCLUDE_DIRS})
|
||||
INCLUDE(BuildPlugin)
|
||||
BUILD_PLUGIN(lv2effect Lv2Effect.cpp Lv2FxControls.cpp Lv2FxControlDialog.cpp Lv2Effect.h Lv2FxControls.h Lv2FxControlDialog.h
|
||||
MOCFILES Lv2Effect.h Lv2FxControls.h Lv2FxControlDialog.h
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
IF(LMMS_HAVE_LV2)
|
||||
INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${LILV_INCLUDE_DIRS})
|
||||
INCLUDE_DIRECTORIES(${SUIL_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${LV2_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${LILV_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${SUIL_INCLUDE_DIRS})
|
||||
INCLUDE(BuildPlugin)
|
||||
BUILD_PLUGIN(lv2instrument Lv2Instrument.cpp Lv2Instrument.h MOCFILES Lv2Instrument.h EMBEDDED_RESOURCES logo.png)
|
||||
ENDIF(LMMS_HAVE_LV2)
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
include(BuildPlugin)
|
||||
|
||||
# Avoid unused warnings for mididata.h
|
||||
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable")
|
||||
ENDIF()
|
||||
add_library(adplug STATIC
|
||||
adplug/src/fmopl.c
|
||||
adplug/src/temuopl.cpp
|
||||
)
|
||||
target_include_directories(adplug PUBLIC adplug/src)
|
||||
set_target_properties(adplug PROPERTIES SYSTEM TRUE)
|
||||
|
||||
INCLUDE_DIRECTORIES(adplug/src)
|
||||
|
||||
BUILD_PLUGIN(opulenz
|
||||
build_plugin(opulenz
|
||||
OpulenZ.cpp
|
||||
OpulenZ.h
|
||||
adplug/src/opl.h
|
||||
adplug/src/fmopl.c
|
||||
adplug/src/fmopl.h
|
||||
adplug/src/temuopl.cpp
|
||||
adplug/src/temuopl.h
|
||||
MOCFILES OpulenZ.h
|
||||
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
|
||||
)
|
||||
target_link_libraries(opulenz adplug)
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "opl.h"
|
||||
#include "temuopl.h"
|
||||
#include "mididata.h"
|
||||
#include <opl.h>
|
||||
#include <temuopl.h>
|
||||
#include <mididata.h>
|
||||
|
||||
#include "embed.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
|
||||
#include "sid.h"
|
||||
#include <sid.h>
|
||||
|
||||
#include "SidInstrument.h"
|
||||
#include "AudioEngine.h"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
# These are the defaults
|
||||
set(RESID_INLINING 1)
|
||||
set(RESID_INLINE inline)
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
include(BuildPlugin)
|
||||
|
||||
INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS})
|
||||
LINK_LIBRARIES(${FFTW3F_LIBRARIES})
|
||||
include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS})
|
||||
link_libraries(${FFTW3F_LIBRARIES})
|
||||
|
||||
INCLUDE_DIRECTORIES(${SAMPLERATE_INCLUDE_DIRS})
|
||||
LINK_DIRECTORIES(${SAMPLERATE_LIBRARY_DIRS})
|
||||
LINK_LIBRARIES(${SAMPLERATE_LIBRARIES})
|
||||
|
||||
BUILD_PLUGIN(slicert SlicerT.cpp SlicerT.h SlicerTView.cpp SlicerTView.h SlicerTWaveform.cpp SlicerTWaveform.h MOCFILES SlicerT.h SlicerTView.h SlicerTWaveform.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")
|
||||
build_plugin(slicert
|
||||
SlicerT.cpp
|
||||
SlicerT.h
|
||||
SlicerTView.cpp
|
||||
SlicerTView.h
|
||||
SlicerTWaveform.cpp
|
||||
SlicerTWaveform.h
|
||||
MOCFILES SlicerT.h SlicerTView.h SlicerTWaveform.h
|
||||
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
|
||||
)
|
||||
target_link_libraries(slicert SampleRate::samplerate)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
INCLUDE_DIRECTORIES(${FFTW3F_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS})
|
||||
|
||||
LINK_LIBRARIES(${FFTW3F_LIBRARIES})
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ if(IS_MINGW)
|
||||
" HAS_STD_MUTEX)
|
||||
|
||||
if(NOT HAS_STD_MUTEX)
|
||||
target_include_directories(${EXE_NAME} PRIVATE
|
||||
target_include_directories(${EXE_NAME} SYSTEM PRIVATE
|
||||
"${LMMS_SOURCE_DIR}/src/3rdparty/mingw-std-threads")
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||
-DUSE_MINGW_THREADS_REPLACEMENT)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
# include <QX11Info>
|
||||
# include "X11EmbedContainer.h"
|
||||
# include <X11EmbedContainer.h>
|
||||
#endif
|
||||
|
||||
#include <QWindow>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
INCLUDE(BuildPlugin)
|
||||
|
||||
INCLUDE_DIRECTORIES(exprtk)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_sc_andor")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_return_statement")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_break_continue")
|
||||
@@ -8,7 +7,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_comments")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_string_capabilities")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_rtl_io_file")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_rtl_vecops")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WERROR_FLAGS} -fexceptions")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
||||
|
||||
IF(LMMS_BUILD_WIN32 AND NOT MSVC)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -Dexprtk_disable_enhanced_features")
|
||||
@@ -16,13 +15,16 @@ ELSEIF(LMMS_BUILD_WIN32 AND MSVC)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
|
||||
ENDIF()
|
||||
|
||||
BUILD_PLUGIN(xpressive
|
||||
add_library(exprtk INTERFACE)
|
||||
target_include_directories(exprtk INTERFACE exprtk)
|
||||
set_target_properties(exprtk PROPERTIES SYSTEM TRUE)
|
||||
|
||||
build_plugin(xpressive
|
||||
Xpressive.cpp
|
||||
ExprSynth.cpp
|
||||
Xpressive.h
|
||||
exprtk/exprtk.hpp
|
||||
ExprSynth.h
|
||||
MOCFILES Xpressive.h
|
||||
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
|
||||
)
|
||||
|
||||
|
||||
target_link_libraries(xpressive exprtk)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "NotePlayHandle.h"
|
||||
|
||||
|
||||
#include "exprtk.hpp"
|
||||
#include <exprtk.hpp>
|
||||
|
||||
#define WARN_EXPRTK qWarning("ExprTk exception")
|
||||
|
||||
@@ -820,4 +820,4 @@ void ExprSynth::renderOutput(fpp_t frames, sampleFrame *buf)
|
||||
}
|
||||
|
||||
|
||||
} // namespace lmms
|
||||
} // namespace lmms
|
||||
|
||||
@@ -12,7 +12,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
# definitions for ZynAddSubFX
|
||||
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD OR LMMS_BUILD_FREEBSD)
|
||||
FIND_PACKAGE(X11)
|
||||
INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
|
||||
include_directories(SYSTEM ${X11_INCLUDE_DIR})
|
||||
ADD_DEFINITIONS(-DOS_LINUX)
|
||||
ELSE()
|
||||
ADD_DEFINITIONS(-DOS_WINDOWS)
|
||||
@@ -44,21 +44,21 @@ IF(NOT EXISTS ${FLTK_FLUID_EXECUTABLE})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
include_directories(
|
||||
include_directories(SYSTEM
|
||||
"${FLTK_INCLUDE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
${FFTW3F_INCLUDE_DIRS}
|
||||
)
|
||||
include_directories(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_SOURCE_DIR}/src/3rdparty/mingw-std-threads"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/zynaddsubfx/src/UI"
|
||||
)
|
||||
|
||||
ADD_DEFINITIONS(-DPLUGINVERSION) # removes exit confirmation dialogs etc. in MasterUI.fl
|
||||
add_subdirectory(zynaddsubfx/src/Nio)
|
||||
add_subdirectory(zynaddsubfx/src/UI)
|
||||
|
||||
SET(zynaddsubfx_core_SRCS
|
||||
add_library(zynaddsubfx_synth OBJECT
|
||||
zynaddsubfx/src/DSP/AnalogFilter.cpp
|
||||
zynaddsubfx/src/DSP/FFTwrapper.cpp
|
||||
zynaddsubfx/src/DSP/Filter.cpp
|
||||
@@ -107,13 +107,32 @@ SET(zynaddsubfx_core_SRCS
|
||||
zynaddsubfx/src/Synth/SUBnote.cpp
|
||||
)
|
||||
|
||||
add_library(ZynAddSubFxCoreObjs OBJECT LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS})
|
||||
add_library(ZynAddSubFxCore INTERFACE)
|
||||
target_sources(ZynAddSubFxCore INTERFACE
|
||||
$<TARGET_OBJECTS:ZynAddSubFxCoreObjs>
|
||||
$<TARGET_OBJECTS:zynaddsubfx_nio>
|
||||
)
|
||||
set_target_properties(zynaddsubfx_nio PROPERTIES SYSTEM TRUE)
|
||||
set_target_properties(zynaddsubfx_gui PROPERTIES SYSTEM TRUE)
|
||||
set_target_properties(zynaddsubfx_synth PROPERTIES SYSTEM TRUE)
|
||||
|
||||
if(MINGW)
|
||||
target_link_libraries(zynaddsubfx_nio PUBLIC mingw_stdthreads)
|
||||
target_link_libraries(zynaddsubfx_gui PUBLIC mingw_stdthreads)
|
||||
target_link_libraries(zynaddsubfx_synth PUBLIC mingw_stdthreads)
|
||||
endif()
|
||||
|
||||
# Relative include paths don't work automatically for the GUI, because the
|
||||
# generated C++ files aren't in the source directory. Thus, add the expected
|
||||
# source directory as an additional include directory.
|
||||
target_include_directories(zynaddsubfx_gui PUBLIC zynaddsubfx/src/UI)
|
||||
|
||||
add_library(ZynAddSubFxCore STATIC
|
||||
LocalZynAddSubFx.cpp
|
||||
)
|
||||
target_include_directories(ZynAddSubFxCore SYSTEM PUBLIC
|
||||
zynaddsubfx/src
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx/src"
|
||||
)
|
||||
target_static_libraries(ZynAddSubFxCore PUBLIC
|
||||
zynaddsubfx_nio
|
||||
zynaddsubfx_synth
|
||||
)
|
||||
target_link_libraries(ZynAddSubFxCore INTERFACE
|
||||
${FFTW3F_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
@@ -132,7 +151,7 @@ ELSE()
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}")
|
||||
ENDIF()
|
||||
BUILD_PLUGIN(zynaddsubfx ZynAddSubFx.cpp ZynAddSubFx.h MOCFILES ZynAddSubFx.h EMBEDDED_RESOURCES artwork.png logo.png)
|
||||
target_link_libraries(zynaddsubfx ZynAddSubFxCore)
|
||||
target_static_libraries(zynaddsubfx ZynAddSubFxCore)
|
||||
|
||||
if(MSVC)
|
||||
set(WINRC "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc")
|
||||
@@ -155,8 +174,8 @@ add_executable(RemoteZynAddSubFx
|
||||
RemoteZynAddSubFx.cpp
|
||||
${LMMS_COMMON_SRCS}
|
||||
"${WINRC}"
|
||||
$<TARGET_OBJECTS:zynaddsubfx_gui>
|
||||
)
|
||||
target_static_libraries(RemoteZynAddSubFx ZynAddSubFxCore zynaddsubfx_gui)
|
||||
INSTALL(TARGETS RemoteZynAddSubFx RUNTIME DESTINATION "${PLUGIN_DIR}")
|
||||
# Needed to deploy dependencies of RemoteZynAddSubFx
|
||||
SET_PROPERTY(GLOBAL APPEND PROPERTY PLUGINS_BUILT "RemoteZynAddSubFx")
|
||||
@@ -176,7 +195,7 @@ IF(FLTK_CONFIG AND NOT (LMMS_BUILD_APPLE OR LMMS_BUILD_WIN32))
|
||||
STRING(REPLACE " " ";" FLTK_FILTERED_LDFLAGS ${FLTK_FILTERED_LDFLAGS})
|
||||
LIST(REMOVE_ITEM FLTK_FILTERED_LDFLAGS -lX11)
|
||||
ENDIF()
|
||||
target_link_libraries(RemoteZynAddSubFx ZynAddSubFxCore ${FLTK_FILTERED_LDFLAGS})
|
||||
target_link_libraries(RemoteZynAddSubFx ${FLTK_FILTERED_LDFLAGS})
|
||||
|
||||
if(LMMS_HAVE_LIBRT)
|
||||
target_link_libraries(RemoteZynAddSubFx rt)
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
|
||||
#include "MidiEvent.h"
|
||||
|
||||
#include "zynaddsubfx/src/Nio/NulEngine.h"
|
||||
#include "zynaddsubfx/src/Misc/Master.h"
|
||||
#include "zynaddsubfx/src/Misc/Part.h"
|
||||
#include "zynaddsubfx/src/Misc/Util.h"
|
||||
#include <Nio/NulEngine.h>
|
||||
#include <Misc/Master.h>
|
||||
#include <Misc/Part.h>
|
||||
#include <Misc/Util.h>
|
||||
|
||||
// Global variable in zynaddsubfx/src/globals.h
|
||||
SYNTH_T* synth = nullptr;
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
#include "RemotePluginClient.h"
|
||||
#include "LocalZynAddSubFx.h"
|
||||
|
||||
#include "zynaddsubfx/src/Nio/Nio.h"
|
||||
#include "zynaddsubfx/src/UI/MasterUI.h"
|
||||
#include <Nio/Nio.h>
|
||||
#include <UI/MasterUI.h>
|
||||
|
||||
using namespace lmms;
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
#include <QMap>
|
||||
#include <QMutex>
|
||||
|
||||
#include <globals.h>
|
||||
|
||||
#include "AutomatableModel.h"
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentView.h"
|
||||
#include "RemotePlugin.h"
|
||||
#include "zynaddsubfx/src/globals.h"
|
||||
|
||||
|
||||
class QPushButton;
|
||||
|
||||
|
||||
30
src/3rdparty/CMakeLists.txt
vendored
30
src/3rdparty/CMakeLists.txt
vendored
@@ -1,8 +1,13 @@
|
||||
set_directory_properties(PROPERTIES SYSTEM TRUE)
|
||||
|
||||
if(LMMS_BUILD_LINUX AND LMMS_HAVE_VST)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
add_subdirectory(qt5-x11embed)
|
||||
ENDIF()
|
||||
|
||||
add_library(jack_headers INTERFACE)
|
||||
target_include_directories(jack_headers INTERFACE jack2/common)
|
||||
|
||||
ADD_SUBDIRECTORY(hiir)
|
||||
ADD_SUBDIRECTORY(weakjack)
|
||||
|
||||
@@ -12,13 +17,22 @@ if(MINGW)
|
||||
set(LMMS_USE_MINGW_STD_THREADS ON PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# The lockless ring buffer library is compiled as part of the core
|
||||
SET(RINGBUFFER_DIR "${CMAKE_SOURCE_DIR}/src/3rdparty/ringbuffer/")
|
||||
SET(RINGBUFFER_DIR ${RINGBUFFER_DIR} PARENT_SCOPE)
|
||||
# The lockless ring buffer library is linked as part of the core
|
||||
add_library(ringbuffer OBJECT
|
||||
ringbuffer/src/lib/ringbuffer.cpp
|
||||
)
|
||||
target_compile_features(ringbuffer PUBLIC cxx_std_17)
|
||||
target_include_directories(ringbuffer PUBLIC
|
||||
ringbuffer/include
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
)
|
||||
# Create a dummy ringbuffer_export.h, since ringbuffer is not compiled as a library
|
||||
FILE(WRITE ${CMAKE_BINARY_DIR}/src/ringbuffer_export.h
|
||||
"#include \"${CMAKE_BINARY_DIR}/src/lmms_export.h\"\n
|
||||
#define RINGBUFFER_EXPORT LMMS_EXPORT")
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ringbuffer_export.h.in" [[
|
||||
#include "${CMAKE_BINARY_DIR}/src/lmms_export.h"
|
||||
#define RINGBUFFER_EXPORT LMMS_EXPORT
|
||||
]])
|
||||
configure_file("${CMAKE_CURRENT_BINARY_DIR}/ringbuffer_export.h.in" ringbuffer_export.h)
|
||||
target_compile_definitions(ringbuffer PRIVATE lmmsobjs_EXPORTS)
|
||||
# Enable MLOCK support for ringbuffer if available
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
CHECK_INCLUDE_FILES(sys/mman.h HAVE_SYS_MMAN)
|
||||
@@ -28,5 +42,5 @@ ELSE()
|
||||
SET(USE_MLOCK OFF)
|
||||
ENDIF()
|
||||
# Generate ringbuffer configuration headers
|
||||
CONFIGURE_FILE(${RINGBUFFER_DIR}/src/ringbuffer-config.h.in ${CMAKE_BINARY_DIR}/src/ringbuffer-config.h)
|
||||
CONFIGURE_FILE(${RINGBUFFER_DIR}/src/ringbuffer-version.h.in ${CMAKE_BINARY_DIR}/src/ringbuffer-version.h)
|
||||
configure_file(ringbuffer/src/ringbuffer-config.h.in ringbuffer-config.h)
|
||||
configure_file(ringbuffer/src/ringbuffer-version.h.in ringbuffer-version.h)
|
||||
|
||||
22
src/3rdparty/weakjack/CMakeLists.txt
vendored
22
src/3rdparty/weakjack/CMakeLists.txt
vendored
@@ -1,12 +1,14 @@
|
||||
# Use weak jack library linking
|
||||
IF(LMMS_HAVE_WEAKJACK)
|
||||
SET(CMAKE_C_FLAGS "-std=c11")
|
||||
|
||||
if(LMMS_HAVE_WEAKJACK)
|
||||
add_library(weakjack STATIC
|
||||
weakjack/weak_libjack.c
|
||||
)
|
||||
target_include_directories(weakjack PUBLIC weakjack)
|
||||
target_link_libraries(weakjack PUBLIC jack_headers ${CMAKE_DL_LIBS})
|
||||
target_compile_features(weakjack PRIVATE c_std_11)
|
||||
# Enable weakjack, disable metadata support
|
||||
ADD_DEFINITIONS(-DUSE_WEAK_JACK=1 -DNO_JACK_METADATA=1)
|
||||
|
||||
# Library stub for AppImages running on systems without jack
|
||||
ADD_LIBRARY(weakjack MODULE weakjack/weak_libjack.c weakjack/weak_libjack.h)
|
||||
TARGET_INCLUDE_DIRECTORIES(weakjack PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/weakjack ${JACK_INCLUDE_DIRS})
|
||||
INSTALL(TARGETS weakjack LIBRARY DESTINATION "${PLUGIN_DIR}/optional")
|
||||
ENDIF()
|
||||
target_compile_definitions(weakjack PUBLIC
|
||||
USE_WEAK_JACK=1
|
||||
NO_JACK_METADATA=1
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -29,7 +29,6 @@ INCLUDE_DIRECTORIES(
|
||||
"${CMAKE_BINARY_DIR}/include"
|
||||
"${CMAKE_SOURCE_DIR}"
|
||||
"${CMAKE_SOURCE_DIR}/include"
|
||||
"${RINGBUFFER_DIR}/include"
|
||||
)
|
||||
|
||||
IF(WIN32 AND MSVC)
|
||||
@@ -55,39 +54,31 @@ ADD_GEN_QRC(LMMS_RCC_OUT lmms.qrc
|
||||
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})
|
||||
INCLUDE_DIRECTORIES(
|
||||
include_directories(SYSTEM
|
||||
${JACK_INCLUDE_DIRS}
|
||||
${SNDIO_INCLUDE_DIRS}
|
||||
${FFTW3F_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
IF(NOT LMMS_HAVE_SDL2 AND 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)
|
||||
include_directories(SYSTEM "${SDL_INCLUDE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES("${PULSEAUDIO_INCLUDE_DIR}")
|
||||
include_directories(SYSTEM "${PULSEAUDIO_INCLUDE_DIR}")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${LV2_INCLUDE_DIRS}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${LV2_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${LILV_INCLUDE_DIRS}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES(${LILV_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${LILV_INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
|
||||
IF(NOT ("${SUIL_INCLUDE_DIRS}" STREQUAL ""))
|
||||
INCLUDE_DIRECTORIES(${SUIL_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${SUIL_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)
|
||||
@@ -108,23 +99,20 @@ GENERATE_EXPORT_HEADER(lmmsobjs
|
||||
|
||||
ADD_EXECUTABLE(lmms
|
||||
core/main.cpp
|
||||
$<TARGET_OBJECTS:lmmsobjs>
|
||||
"${WINRC}"
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(lmms
|
||||
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
target_static_libraries(lmms PUBLIC lmmsobjs)
|
||||
|
||||
# CMake doesn't define target_EXPORTS for OBJECT libraries.
|
||||
# See the documentation of DEFINE_SYMBOL for details.
|
||||
# Also add LMMS_STATIC_DEFINE for targets linking against it.
|
||||
TARGET_COMPILE_DEFINITIONS(lmmsobjs
|
||||
PRIVATE -Dlmmsobjs_EXPORTS
|
||||
INTERFACE -DLMMS_STATIC_DEFINE
|
||||
)
|
||||
TARGET_COMPILE_DEFINITIONS(lmms
|
||||
PRIVATE $<TARGET_PROPERTY:lmmsobjs,INTERFACE_COMPILE_DEFINITIONS>
|
||||
)
|
||||
target_static_definitions(lmmsobjs LMMS_STATIC_DEFINE)
|
||||
|
||||
# Set Visual Studio startup project to lmms
|
||||
# https://stackoverflow.com/a/37994396/8166701
|
||||
@@ -189,21 +177,10 @@ SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS}
|
||||
${EXTRA_LIBRARIES}
|
||||
)
|
||||
|
||||
# Expose required libs for tests binary
|
||||
SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS} PARENT_SCOPE)
|
||||
|
||||
TARGET_LINK_LIBRARIES(lmms
|
||||
target_link_libraries(lmmsobjs
|
||||
${LMMS_REQUIRED_LIBS}
|
||||
)
|
||||
|
||||
FOREACH(LIB ${LMMS_REQUIRED_LIBS})
|
||||
IF(TARGET ${LIB})
|
||||
GET_TARGET_PROPERTY(INCLUDE_DIRS ${LIB} INTERFACE_INCLUDE_DIRECTORIES)
|
||||
IF(INCLUDE_DIRS)
|
||||
TARGET_INCLUDE_DIRECTORIES(lmmsobjs PRIVATE ${INCLUDE_DIRS})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
target_static_libraries(lmmsobjs ringbuffer)
|
||||
|
||||
set_target_properties(lmms PROPERTIES
|
||||
ENABLE_EXPORTS ON
|
||||
|
||||
@@ -16,18 +16,17 @@ foreach(LMMS_TEST_SRC IN LISTS LMMS_TESTS)
|
||||
# TODO CMake 3.20: Use cmake_path
|
||||
get_filename_component(LMMS_TEST_NAME ${LMMS_TEST_SRC} NAME_WE)
|
||||
|
||||
add_executable(${LMMS_TEST_NAME} $<TARGET_OBJECTS:lmmsobjs> ${LMMS_TEST_SRC})
|
||||
add_executable(${LMMS_TEST_NAME} ${LMMS_TEST_SRC})
|
||||
add_test(NAME ${LMMS_TEST_NAME} COMMAND ${LMMS_TEST_NAME})
|
||||
|
||||
# TODO CMake 3.12: Propagate usage requirements by linking to lmmsobjs
|
||||
target_include_directories(${LMMS_TEST_NAME} PRIVATE $<TARGET_PROPERTY:lmmsobjs,INCLUDE_DIRECTORIES>)
|
||||
|
||||
target_static_libraries("${LMMS_TEST_NAME}" PRIVATE lmmsobjs)
|
||||
target_link_libraries(${LMMS_TEST_NAME} PRIVATE
|
||||
${LMMS_REQUIRED_LIBS}
|
||||
${QT_LIBRARIES}
|
||||
${QT_QTTEST_LIBRARY}
|
||||
)
|
||||
|
||||
target_compile_features(${LMMS_TEST_NAME} PRIVATE cxx_std_17)
|
||||
target_compile_definitions(${LMMS_TEST_NAME} PRIVATE $<TARGET_PROPERTY:lmmsobjs,INTERFACE_COMPILE_DEFINITIONS>)
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user