Browse Source

Disable dev mode, use source dir as system dir; Fix some builds

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.02
falkTX 4 years ago
parent
commit
a482ee7b73
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 64 additions and 33 deletions
  1. +2
    -8
      Makefile
  2. +1
    -1
      dpf
  3. +12
    -6
      plugins/Cardinal/CardinalPlugin.cpp
  4. +2
    -2
      plugins/Cardinal/CardinalUI.cpp
  5. +47
    -16
      plugins/Cardinal/Makefile

+ 2
- 8
Makefile View File

@@ -6,7 +6,7 @@

include dpf/Makefile.base.mk

all: dgl plugins gen resources
all: dgl plugins gen

# --------------------------------------------------------------

@@ -17,22 +17,16 @@ plugins: dgl
$(MAKE) all -C plugins/Cardinal

ifneq ($(CROSS_COMPILING),true)
gen: plugins resources dpf/utils/lv2_ttl_generator
gen: plugins dpf/utils/lv2_ttl_generator
@$(CURDIR)/dpf/utils/generate-ttl.sh
ifeq ($(MACOS),true)
@$(CURDIR)/dpf/utils/generate-vst-bundles.sh
endif

resources: bin/Cardinal.lv2/res

bin/Cardinal.lv2/res: plugins
ln -sf $(CURDIR)/plugins/Cardinal/Rack/res bin/Cardinal.lv2/res

dpf/utils/lv2_ttl_generator:
$(MAKE) -C dpf/utils/lv2-ttl-generator
else
gen:
resources:
endif

# --------------------------------------------------------------


+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit a1322bc0c5814633ec3c82080540a2657f4f4486
Subproject commit 65eb8c098d6ed2c3407b761e8b967f82e0a7b8a7

+ 12
- 6
plugins/Cardinal/CardinalPlugin.cpp View File

@@ -58,13 +58,18 @@ struct Initializer {
{
using namespace rack;
settings::devMode = true;
settings::autoCheckUpdates = false;
settings::autosaveInterval = 0;
settings::discordUpdateActivity = false;
settings::isPlugin = true;
system::init();
asset::init();
logger::init();
random::init();
// Make system dir point to source code location. It is good enough for now
asset::systemDir = CARDINAL_PLUGIN_SOURCE_DIR DISTRHO_OS_SEP_STR "Rack";
// Log environment
INFO("%s %s v%s", APP_NAME.c_str(), APP_EDITION.c_str(), APP_VERSION.c_str());
INFO("%s", system::getOperatingSystemInfo().c_str());
@@ -107,20 +112,20 @@ struct Initializer {
keyboard::init();
plugin::init();
library::init();
ui::init();
ui::init();
}
~Initializer()
{
using namespace rack;
ui::destroy();
ui::destroy();
library::destroy();
midi::destroy();
audio::destroy();
plugin::destroy();
INFO("Destroying logger");
logger::destroy();
INFO("Destroying logger");
logger::destroy();
}
};
@@ -144,7 +149,7 @@ class CardinalPlugin : public Plugin
~ScopedContext()
{
rack::contextSet(nullptr);
rack::contextSet(nullptr);
}
};
@@ -161,6 +166,7 @@ public:
fContext->scene = new rack::app::Scene;
fContext->event->rootWidget = fContext->scene;
fContext->patch = new rack::patch::Manager;
fContext->patch->autosavePath = "/OBVIOUSLY-NOT-VALID-PATH/";
fContext->engine->startFallbackThread();
}


+ 2
- 2
plugins/Cardinal/CardinalUI.cpp View File

@@ -64,7 +64,7 @@ class CardinalUI : public UI

~ScopedContext()
{
rack::contextSet(nullptr);
rack::contextSet(nullptr);
}
};

@@ -95,7 +95,7 @@ public:
{
const ScopedContext sc(this);

fContext->window->step();
fContext->window->step();
}

void uiIdle() override


+ 47
- 16
plugins/Cardinal/Makefile View File

@@ -24,6 +24,7 @@ FILES_UI = \
# Import base definitions

USE_NANOVG_FBO = true
USE_RGBA = true
include ../../dpf/Makefile.base.mk

# --------------------------------------------------------------
@@ -65,16 +66,40 @@ EXTRA_LIBS += Rack/dep/lib/libzstd.a

include ../../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Fix up cmake for windows cross-compilation

ifeq ($(WINDOWS),true)
CMAKE := cmake -G 'Unix Makefiles' -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=$(subst gcc,windres,$(CC))
else
CMAKE := cmake
endif

BUILD_C_FLAGS += -std=gnu11
CMAKE += -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX='$(abspath Rack/dep)'

# --------------------------------------------------------------
# override VCV arch.mk stuff so we can build more architectures

ifeq ($(CPU_ARM),true)
ARCH_NAME = arm
MACHINE = i686-bring-forth-the-rack
else ifeq ($(CPU_ARM64),true)
ARCH_NAME = arm64
MACHINE = x86_64-bring-forth-the-rack
else ifeq ($(CPU_AARCH64),true)
ARCH_NAME = aarch64
MACHINE = x86_64-bring-forth-the-rack
endif

ifneq ($(MACOS_OR_WINDOWS),true)
MACHINE += -linux
endif

# --------------------------------------------------------------
# VCV internal dependencies target

Rack/dep/lib/%.a:
$(MAKE) CMAKE="$(CMAKE) -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX='$(abspath Rack/dep)'" -C Rack/dep lib/$*.a
$(MAKE) ARCH_NAME=$(ARCH_NAME) CMAKE="$(CMAKE)" MACHINE=$(MACHINE) -C Rack/dep lib/$*.a

Rack/dep/lib/libarchive.a: Rack/dep/lib/libzstd.a

@@ -83,7 +108,25 @@ Rack/dep/lib/libarchive_static.a: Rack/dep/lib/libzstd.a
# --------------------------------------------------------------
# Extra flags for VCV stuff

BASE_FLAGS += -D_APP_VERSION=2.git.0
ifeq ($(MACOS),true)
BASE_FLAGS += -DARCH_MAC
else ifeq ($(WINDOWS),true)
BASE_FLAGS += -DARCH_WIN
else
BASE_FLAGS += -DARCH_LIN
endif

BUILD_C_FLAGS += -std=gnu11

# temporary macro just to get the ball rolling
ifeq ($(EXE_WRAPPER),wine)
SOURCE_DIR = Z:$(subst /,\\,$(CURDIR))
else
SOURCE_DIR = $(CURDIR)
endif
BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_SOURCE_DIR='"$(SOURCE_DIR)"'

BASE_FLAGS += -D_APP_VERSION=Cardinal
BASE_FLAGS += -I$(DPF_PATH)/dgl/src/nanovg
BASE_FLAGS += -IRack/include
BASE_FLAGS += -IRack/dep/include
@@ -94,20 +137,13 @@ BASE_FLAGS += -IRack/dep/nanosvg/src
BASE_FLAGS += -IRack/dep/osdialog
BASE_FLAGS += -IRack/dep/oui-blendish
BASE_FLAGS += -IRack/dep/pffft
BASE_FLAGS += -pthread

ifeq ($(WINDOWS),true)
BASE_FLAGS += -Imingw-compat
BUILD_CXX_FLAGS += -Imingw-std-threads
endif

ifeq ($(MACOS),true)
BASE_FLAGS += -DARCH_MAC
else ifeq ($(WINDOWS),true)
BASE_FLAGS += -DARCH_WIN
else
BASE_FLAGS += -DARCH_LIN
endif

# FIXME lots of warnings from VCV side
BASE_FLAGS += -Wno-unused-parameter
BASE_FLAGS += -Wno-unused-variable
@@ -123,11 +159,6 @@ else ifeq ($(WINDOWS),true)
LINK_FLAGS += -ldbghelp -lshlwapi
endif

# LINK_FLAGS += $(OPENGL_LIBS)

# TODO needed on windows? need to check
LINK_FLAGS += -lpthread

# --------------------------------------------------------------
# Enable all possible plugin types



Loading…
Cancel
Save