Allow to link against system dependencies
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
28bcac708f
commit
6675a1e81d
4 changed files with 46 additions and 11 deletions
24
Makefile
24
Makefile
|
@ -18,12 +18,22 @@ SYSDEPS ?= false
|
|||
# --------------------------------------------------------------
|
||||
# Check for system-wide dependencies
|
||||
|
||||
# HAVE_LIBARCHIVE = $(shell pkg-config --exists libarchive && echo true)
|
||||
#
|
||||
# libjansson.a
|
||||
# libsamplerate.a
|
||||
# libspeexdsp.a
|
||||
# libzstd.a
|
||||
ifeq ($(SYSDEPS),true)
|
||||
|
||||
ifneq ($(shell pkg-config --exists jansson && echo true),true)
|
||||
$(error jansson dpendency not installed/available)
|
||||
endif
|
||||
ifneq ($(shell pkg-config --exists libarchive && echo true),true)
|
||||
$(error libarchive dpendency not installed/available)
|
||||
endif
|
||||
ifneq ($(shell pkg-config --exists samplerate && echo true),true)
|
||||
$(error samplerate dpendency not installed/available)
|
||||
endif
|
||||
ifneq ($(shell pkg-config --exists speexdsp && echo true),true)
|
||||
$(error speexdsp dpendency not installed/available)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
# --------------------------------------------------------------
|
||||
|
||||
|
@ -31,7 +41,9 @@ cardinal: deps dgl plugins
|
|||
$(MAKE) all -C src
|
||||
|
||||
deps:
|
||||
ifneq ($(SYSDEPS),true)
|
||||
$(MAKE) all -C deps
|
||||
endif
|
||||
|
||||
dgl:
|
||||
$(MAKE) USE_NANOVG_FBO=true USE_RGBA=true -C dpf/dgl opengl
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
# Created by falkTX
|
||||
#
|
||||
|
||||
DEP_PATH = $(abspath ../src/Rack/dep)
|
||||
# --------------------------------------------------------------
|
||||
# Build config
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
DESTDIR ?=
|
||||
SYSDEPS ?= false
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# Import base definitions
|
||||
|
@ -259,9 +264,6 @@ BASE_FLAGS += -I../include/neon-compat
|
|||
BASE_FLAGS += -I../src
|
||||
BASE_FLAGS += -I../src/Rack/include
|
||||
BASE_FLAGS += -I../src/Rack/include/dsp
|
||||
BASE_FLAGS += -I../src/Rack/dep/include
|
||||
# BASE_FLAGS += -I../src/Rack/dep/filesystem/include
|
||||
# BASE_FLAGS += -I../src/Rack/dep/fuzzysearchdatabase/src
|
||||
BASE_FLAGS += -I../src/Rack/dep/glfw/include
|
||||
BASE_FLAGS += -I../src/Rack/dep/nanosvg/src
|
||||
BASE_FLAGS += -I../src/Rack/dep/osdialog
|
||||
|
@ -269,6 +271,12 @@ BASE_FLAGS += -I../src/Rack/dep/oui-blendish
|
|||
BASE_FLAGS += -I../src/Rack/dep/pffft
|
||||
BASE_FLAGS += -pthread
|
||||
|
||||
# ifneq ($(SYSDEPS),true)
|
||||
# BASE_FLAGS += -I../src/Rack/dep/include
|
||||
# # BASE_FLAGS += -I../src/Rack/dep/filesystem/include
|
||||
# # BASE_FLAGS += -I../src/Rack/dep/fuzzysearchdatabase/src
|
||||
# endif
|
||||
|
||||
ifeq ($(WINDOWS),true)
|
||||
BASE_FLAGS += -D_USE_MATH_DEFINES
|
||||
BASE_FLAGS += -DWIN32_LEAN_AND_MEAN
|
||||
|
|
|
@ -85,11 +85,13 @@ struct Initializer {
|
|||
|
||||
if (asset::systemDir.empty())
|
||||
{
|
||||
#ifdef CARDINAL_PLUGIN_SOURCE_DIR
|
||||
// Make system dir point to source code location as fallback
|
||||
asset::systemDir = CARDINAL_PLUGIN_SOURCE_DIR DISTRHO_OS_SEP_STR "Rack";
|
||||
|
||||
// And if that fails, use install target prefix
|
||||
if (! system::isDirectory(system::join(asset::systemDir, "res")))
|
||||
#endif
|
||||
{
|
||||
asset::bundlePath = CARDINAL_PLUGIN_PREFIX "/share/Cardinal/PluginManifests";
|
||||
asset::systemDir = CARDINAL_PLUGIN_PREFIX "/share/Cardinal";
|
||||
|
|
15
src/Makefile
15
src/Makefile
|
@ -60,6 +60,7 @@ FILES_DSP += $(filter-out Rack/src/window/Window.cpp, $(wildcard Rack/src/*/*.cp
|
|||
# --------------------------------------------------------------
|
||||
# Extra libraries to link against
|
||||
|
||||
ifneq ($(SYSDEPS),true)
|
||||
EXTRA_LIBS = ../plugins/plugins.a
|
||||
EXTRA_LIBS += Rack/dep/lib/libjansson.a
|
||||
EXTRA_LIBS += Rack/dep/lib/libsamplerate.a
|
||||
|
@ -72,6 +73,7 @@ endif
|
|||
EXTRA_LIBS += Rack/dep/lib/libzstd.a
|
||||
|
||||
EXTRA_DEPENDENCIES = $(EXTRA_LIBS)
|
||||
endif
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# Do some magic
|
||||
|
@ -98,7 +100,11 @@ BASE_FLAGS += -I../dpf/dgl/src/nanovg
|
|||
BASE_FLAGS += -I../include
|
||||
BASE_FLAGS += -I../include/neon-compat
|
||||
BASE_FLAGS += -IRack/include
|
||||
ifeq ($(SYSDEPS),true)
|
||||
BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp)
|
||||
else
|
||||
BASE_FLAGS += -IRack/dep/include
|
||||
endif
|
||||
BASE_FLAGS += -IRack/dep/filesystem/include
|
||||
BASE_FLAGS += -IRack/dep/fuzzysearchdatabase/src
|
||||
BASE_FLAGS += -IRack/dep/glfw/include
|
||||
|
@ -144,12 +150,16 @@ LINK_FLAGS += -ldbghelp -lshlwapi
|
|||
EXTRA_LIBS += -lws2_32 -lwinmm
|
||||
endif
|
||||
|
||||
ifeq ($(SYSDEPS),true)
|
||||
LINK_FLAGS += $(shell pkg-config --libs jansson libarchive samplerate speexdsp)
|
||||
endif
|
||||
|
||||
ifeq ($(WITH_LTO),true)
|
||||
LINK_FLAGS += -fno-strict-aliasing -flto -Werror=odr -Werror=lto-type-mismatch
|
||||
endif
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# temporary macro just to get the ball rolling
|
||||
# fallback path to resource files
|
||||
|
||||
ifeq ($(EXE_WRAPPER),wine)
|
||||
SOURCE_DIR = Z:$(subst /,\\,$(CURDIR))
|
||||
|
@ -157,7 +167,10 @@ else
|
|||
SOURCE_DIR = $(CURDIR)
|
||||
endif
|
||||
|
||||
ifneq ($(SYSDEPS),true)
|
||||
BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_SOURCE_DIR='"$(SOURCE_DIR)"'
|
||||
endif
|
||||
|
||||
BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"'
|
||||
|
||||
# --------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue