Browse Source

Reorganize files, add Fundamental plugins

tags/22.02
falkTX 3 years ago
parent
commit
2a5769a6ca
27 changed files with 515 additions and 157 deletions
  1. +6
    -3
      .gitmodules
  2. +15
    -14
      Makefile
  3. +149
    -0
      deps/Makefile
  4. +1
    -1
      dpf
  5. +0
    -24
      plugins/Cardinal/GL/glew.h
  6. +0
    -1
      plugins/Cardinal/Rack
  7. +1
    -0
      plugins/Fundamental
  8. +99
    -0
      plugins/Makefile
  9. +67
    -0
      plugins/plugins.cpp
  10. +8
    -0
      src/CardinalPlugin.cpp
  11. +0
    -0
      src/CardinalUI.cpp
  12. +0
    -0
      src/DistrhoPluginInfo.h
  13. +124
    -0
      src/GL/glew.h
  14. +35
    -112
      src/Makefile
  15. +1
    -0
      src/Rack
  16. +0
    -0
      src/ResizeHandle.hpp
  17. +1
    -0
      src/Window.cpp
  18. +8
    -2
      src/dep.cpp
  19. +0
    -0
      src/mingw-compat/Shlobj.h
  20. +0
    -0
      src/mingw-compat/Shlwapi.h
  21. +0
    -0
      src/mingw-compat/Windows.h
  22. +0
    -0
      src/mingw-compat/condition_variable
  23. +0
    -0
      src/mingw-compat/mutex
  24. +0
    -0
      src/mingw-compat/thread
  25. +0
    -0
      src/mingw-std-threads
  26. +0
    -0
      src/neon-compat/pmmintrin.h
  27. +0
    -0
      src/sse2neon

+ 6
- 3
.gitmodules View File

@@ -1,12 +1,15 @@
[submodule "plugins/Cardinal/Rack"]
path = plugins/Cardinal/Rack
path = src/Rack
url = https://github.com/VCVRack/Rack.git
[submodule "dpf"]
path = dpf
url = https://github.com/DISTRHO/DPF.git
[submodule "plugins/Cardinal/mingw-std-threads"]
path = plugins/Cardinal/mingw-std-threads
path = src/mingw-std-threads
url = https://github.com/meganz/mingw-std-threads.git
[submodule "plugins/Cardinal/sse2neon"]
path = plugins/Cardinal/sse2neon
path = src/sse2neon
url = https://github.com/DLTcollab/sse2neon.git
[submodule "plugins/Fundamental"]
path = plugins/Fundamental
url = https://github.com/VCVRack/Fundamental.git

+ 15
- 14
Makefile View File

@@ -6,18 +6,25 @@

include dpf/Makefile.base.mk

all: dgl plugins gen
all: cardinal deps dgl plugins gen

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

cardinal: deps dgl plugins
$(MAKE) all -C src

deps:
$(MAKE) all -C deps

dgl:
$(MAKE) USE_NANOVG_FBO=true USE_RGBA=true -C dpf/dgl opengl
# $(MAKE) opengl -C dpf/dgl USE_NANOVG_FBO=true USE_RGBA=true

plugins: dgl
$(MAKE) all -C plugins/Cardinal
plugins: deps
$(MAKE) all -C plugins

ifneq ($(CROSS_COMPILING),true)
gen: plugins dpf/utils/lv2_ttl_generator
gen: cardinal dpf/utils/lv2_ttl_generator
@$(CURDIR)/dpf/utils/generate-ttl.sh
ifeq ($(MACOS),true)
@$(CURDIR)/dpf/utils/generate-vst-bundles.sh
@@ -32,19 +39,13 @@ endif
# --------------------------------------------------------------

clean:
$(MAKE) clean -C deps
$(MAKE) clean -C dpf/dgl
$(MAKE) clean -C dpf/utils/lv2-ttl-generator
$(MAKE) clean -C plugins/Cardinal
$(MAKE) clean -C plugins
$(MAKE) clean -C src
rm -rf bin build
rm -rf plugins/Cardinal/Rack/dep/bin
rm -rf plugins/Cardinal/Rack/dep/include
rm -rf plugins/Cardinal/Rack/dep/lib
rm -rf plugins/Cardinal/Rack/dep/share
rm -rf plugins/Cardinal/Rack/dep/jansson-2.12
rm -rf plugins/Cardinal/Rack/dep/libarchive-3.4.3
rm -rf plugins/Cardinal/Rack/dep/speexdsp-SpeexDSP-1.2rc3
rm -rf plugins/Cardinal/Rack/dep/zstd-1.4.5

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

.PHONY: plugins
.PHONY: deps plugins

+ 149
- 0
deps/Makefile View File

@@ -0,0 +1,149 @@
#!/usr/bin/make -f
# Makefile for Cardinal #
# --------------------- #
# Created by falkTX
#

DEP_PATH = $(abspath ../src/Rack/dep)

# --------------------------------------------------------------
# Import base definitions

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

# --------------------------------------------------------------
# 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
else
MACHINE = $(TARGET_MACHINE)
endif

ifneq ($(MACOS_OR_WINDOWS),true)
MACHINE_SUFFIX = -linux
endif

# NOTE speex fails to build when neon is enabled
CONFIGURE = ./configure --prefix="$(DEP_PATH)" --host=$(TARGET_MACHINE) --enable-neon=no

# --------------------------------------------------------------
# Fix up cmake

SPACE =
SPACE +=

CMAKE = cmake

ifneq (,$(findstring -arch$(SPACE),$(CXXFLAGS)))
CMAKE += -DCMAKE_OSX_ARCHITECTURES='$(subst $(SPACE),;,$(subst -arch=,,$(filter -arch=%,$(subst -arch$(SPACE),-arch=,$(CXXFLAGS)))))'
endif
ifneq (,$(findstring -mmacosx-version-min=,$(CXXFLAGS)))
CMAKE += -DCMAKE_OSX_DEPLOYMENT_TARGET=$(subst -mmacosx-version-min=,,$(filter -mmacosx-version-min=%,$(CXXFLAGS)))
endif

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

ifeq ($(DEBUG),true)
CMAKE += -DCMAKE_BUILD_TYPE=Debug
else
CMAKE += -DCMAKE_BUILD_TYPE=Release
endif

CMAKE += -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX='$(DEP_PATH)'

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

$(DEP_PATH)/lib/%.a:
$(MAKE) \
ARCH_NAME=$(ARCH_NAME) \
CFLAGS="$(BUILD_C_FLAGS)" \
CXXFLAGS="$(BUILD_CXX_FLAGS)" \
LDFLAGS="$(LINK_FLAGS)" \
CMAKE="$(CMAKE)" \
CONFIGURE="$(CONFIGURE)" \
DEP_FLAGS="$(BASE_FLAGS)" \
DEP_MAC_SDK_FLAGS= \
MACHINE=$(MACHINE)$(MACHINE_SUFFIX) \
-C $(DEP_PATH) lib/$*.a

$(DEP_PATH)/lib/libarchive.a: $(DEP_PATH)/lib/libzstd.a

$(DEP_PATH)/lib/libarchive_static.a: $(DEP_PATH)/lib/libzstd.a

ifeq ($(MACOS),true)
# zstd cmake is borked, see https://github.com/facebook/zstd/issues/1401
$(DEP_PATH)/lib/libzstd.a: $(DEP_PATH)/zstd-1.4.5/.stamp-patched

$(DEP_PATH)/zstd-1.4.5/.stamp-patched:
$(MAKE) -C $(DEP_PATH) zstd-1.4.5
sed -i -e "56,66d" $(DEP_PATH)/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
touch $@
endif

# libsamplerate fails to link its tests in some systems
$(DEP_PATH)/libsamplerate-0.1.9:
$(MAKE) -C $(DEP_PATH) libsamplerate-0.1.9

$(DEP_PATH)/lib/libsamplerate.a: $(DEP_PATH)/libsamplerate-0.1.9
cd $(DEP_PATH)/libsamplerate-0.1.9 && $(CONFIGURE) --disable-fftw --disable-sndfile
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/termination_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/simple_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/misc_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/callback_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/reset_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/varispeed_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/float_short_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/multi_channel_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/callback_hang_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/src-evaluate
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/throughput_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/multichan_throughput_test
touch $(DEP_PATH)/libsamplerate-0.1.9/tests/downsample_test
$(MAKE) -C $(DEP_PATH)/libsamplerate-0.1.9
$(MAKE) -C $(DEP_PATH)/libsamplerate-0.1.9 install

# --------------------------------------------------------------
# Build targets

TARGETS += $(DEP_PATH)/lib/libjansson.a
TARGETS += $(DEP_PATH)/lib/libsamplerate.a
TARGETS += $(DEP_PATH)/lib/libspeexdsp.a

ifeq ($(WINDOWS),true)
TARGETS += $(DEP_PATH)/lib/libarchive_static.a
else
TARGETS += $(DEP_PATH)/lib/libarchive.a
endif

TARGETS += $(DEP_PATH)/lib/libzstd.a

all: $(TARGETS)

clean:
rm -f $(TARGETS)
rm -rf $(DEP_PATH)/bin
rm -rf $(DEP_PATH)/include
rm -rf $(DEP_PATH)/lib
rm -rf $(DEP_PATH)/share
rm -rf $(DEP_PATH)/jansson-2.12
rm -rf $(DEP_PATH)/libarchive-3.4.3
rm -rf $(DEP_PATH)/libsamplerate-0.1.9
rm -rf $(DEP_PATH)/speexdsp-SpeexDSP-1.2rc3
rm -rf $(DEP_PATH)/zstd-1.4.5

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

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 2711cbefa481c3ebed1ca9dbda190bf915d8b0b9
Subproject commit 2f1b5127cc2da84e3c3f155808efb34d650b3489

+ 0
- 24
plugins/Cardinal/GL/glew.h View File

@@ -1,24 +0,0 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

#pragma once

#ifdef NDEBUG
# undef DEBUG
#endif

#include "OpenGL.hpp"

+ 0
- 1
plugins/Cardinal/Rack

@@ -1 +0,0 @@
Subproject commit 042a9ce026d253700ea14e340182900162ab4653

+ 1
- 0
plugins/Fundamental

@@ -0,0 +1 @@
Subproject commit baaf463db2bcd9d4f577f209b3795d7321a174fe

+ 99
- 0
plugins/Makefile View File

@@ -0,0 +1,99 @@
#!/usr/bin/make -f
# Makefile for Cardinal #
# --------------------- #
# Created by falkTX
#

DEP_PATH = $(abspath ../src/Rack/dep)

# --------------------------------------------------------------
# Import base definitions

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

# --------------------------------------------------------------
# Files to build

PLUGIN_FILES = plugins.cpp

# Fundamental
PLUGIN_FILES += $(filter-out Fundamental/src/plugin.cpp,$(wildcard Fundamental/src/*.cpp))

# --------------------------------------------------------------
# Build setup

BUILD_DIR = ../build/plugins

PLUGIN_OBJS = $(PLUGIN_FILES:%=$(BUILD_DIR)/%.o)

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

BASE_FLAGS += -I../dpf/dgl/src/nanovg
BASE_FLAGS += -I../src
BASE_FLAGS += -I../src/neon-compat
BASE_FLAGS += -I../src/Rack/include
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
BASE_FLAGS += -I../src/Rack/dep/oui-blendish
BASE_FLAGS += -I../src/Rack/dep/pffft
BASE_FLAGS += -pthread

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

# --------------------------------------------------------------
# FIXME lots of warnings from VCV side

BASE_FLAGS += -Wno-unused-parameter
BASE_FLAGS += -Wno-unused-variable

# --------------------------------------------------------------
# Build targets

TARGET = plugins.a

all: $(TARGET)

clean:
rm -f $(TARGET)
rm -rf $(BUILD_DIR)

# --------------------------------------------------------------
# Build commands

$(TARGET): $(PLUGIN_OBJS)
@echo "Creating $@"
$(SILENT)rm -f $@
$(SILENT)$(AR) crs $@ $^

$(BUILD_DIR)/plugins.cpp.o: plugins.cpp
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DpluginInstance=pluginInstance__Fundamental -c -o $@

$(BUILD_DIR)/Fundamental/%.cpp.o: Fundamental/%.cpp
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)"
@echo "Compiling $<"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -DpluginInstance=pluginInstance__Fundamental -c -o $@

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

-include $(PLUGIN_OBJS:%.o=%.d)

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

+ 67
- 0
plugins/plugins.cpp View File

@@ -0,0 +1,67 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

#include <plugin.hpp>

#include "Fundamental/src/plugin.hpp"

Plugin* pluginInstance__Fundamental;

namespace rack {
namespace plugin {

static void initStatic__Fundamental()
{
Plugin* p = new Plugin;
pluginInstance__Fundamental = p;
p->addModel(modelVCO);
p->addModel(modelVCO2);
p->addModel(modelVCF);
p->addModel(modelVCA_1);
p->addModel(modelVCA);
p->addModel(modelLFO);
p->addModel(modelLFO2);
p->addModel(modelDelay);
p->addModel(modelADSR);
p->addModel(modelVCMixer);
p->addModel(model_8vert);
p->addModel(modelUnity);
p->addModel(modelMutes);
p->addModel(modelPulses);
p->addModel(modelScope);
p->addModel(modelSEQ3);
p->addModel(modelSequentialSwitch1);
p->addModel(modelSequentialSwitch2);
p->addModel(modelOctave);
p->addModel(modelQuantizer);
p->addModel(modelSplit);
p->addModel(modelMerge);
p->addModel(modelSum);
p->addModel(modelViz);
p->addModel(modelMidSide);
p->addModel(modelNoise);
p->addModel(modelRandom);
plugins.push_back(p);
}

void initStaticPlugins()
{
initStatic__Fundamental();
}

}
}

plugins/Cardinal/CardinalPlugin.cpp → src/CardinalPlugin.cpp View File

@@ -40,6 +40,12 @@
#endif
#include "DistrhoPlugin.hpp"
namespace rack {
namespace plugin {
void initStaticPlugins();
}
}
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------------------------------------------
@@ -111,6 +117,8 @@ struct Initializer {
midi::init(); // does nothing
plugin::init();
ui::init();
plugin::initStaticPlugins();
}
~Initializer()

plugins/Cardinal/CardinalUI.cpp → src/CardinalUI.cpp View File


plugins/Cardinal/DistrhoPluginInfo.h → src/DistrhoPluginInfo.h View File


+ 124
- 0
src/GL/glew.h View File

@@ -0,0 +1,124 @@
/*
* DISTRHO Cardinal Plugin
* Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* For a full copy of the GNU General Public License see the LICENSE file.
*/

// this file matches the top of `OpenGL.hpp` provided by DPF

#pragma once

#ifdef NDEBUG
# undef DEBUG
#endif

/* Check OS */
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# define DISTRHO_OS_WINDOWS 1
#else
# if defined(__APPLE__)
# define DISTRHO_OS_MAC 1
# endif
#endif

// -----------------------------------------------------------------------
// Fix OpenGL includes for Windows, based on glfw code (part 1)

#undef DGL_CALLBACK_DEFINED
#undef DGL_WINGDIAPI_DEFINED

#ifdef DISTRHO_OS_WINDOWS

#ifndef APIENTRY
# define APIENTRY __stdcall
#endif // APIENTRY

/* We need WINGDIAPI defined */
#ifndef WINGDIAPI
# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__POCC__)
# define WINGDIAPI __declspec(dllimport)
# elif defined(__LCC__)
# define WINGDIAPI __stdcall
# else
# define WINGDIAPI extern
# endif
# define DGL_WINGDIAPI_DEFINED
#endif // WINGDIAPI

/* Some <GL/glu.h> files also need CALLBACK defined */
#ifndef CALLBACK
# if defined(_MSC_VER)
# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
# define CALLBACK __stdcall
# else
# define CALLBACK
# endif
# else
# define CALLBACK __stdcall
# endif
# define DGL_CALLBACK_DEFINED
#endif // CALLBACK

/* Most GL/glu.h variants on Windows need wchar_t */
#include <cstddef>

#endif // DISTRHO_OS_WINDOWS

// -----------------------------------------------------------------------
// OpenGL includes

#ifdef DISTRHO_OS_MAC
# ifdef DGL_USE_OPENGL3
# include <OpenGL/gl3.h>
# include <OpenGL/gl3ext.h>
# else
# include <OpenGL/gl.h>
# endif
#else
# ifdef DISTRHO_OS_WINDOWS
# define GL_GLEXT_PROTOTYPES
# endif
# ifndef __GLEW_H__
# include <GL/gl.h>
# include <GL/glext.h>
# endif
#endif

// -----------------------------------------------------------------------
// Missing OpenGL defines

#if defined(GL_BGR_EXT) && !defined(GL_BGR)
# define GL_BGR GL_BGR_EXT
#endif

#if defined(GL_BGRA_EXT) && !defined(GL_BGRA)
# define GL_BGRA GL_BGRA_EXT
#endif

#ifndef GL_CLAMP_TO_BORDER
# define GL_CLAMP_TO_BORDER 0x812D
#endif

// -----------------------------------------------------------------------
// Fix OpenGL includes for Windows, based on glfw code (part 2)

#ifdef DGL_CALLBACK_DEFINED
# undef CALLBACK
# undef DGL_CALLBACK_DEFINED
#endif

#ifdef DGL_WINGDIAPI_DEFINED
# undef WINGDIAPI
# undef DGL_WINGDIAPI_DEFINED
#endif

plugins/Cardinal/Makefile → src/Makefile View File

@@ -25,7 +25,7 @@ FILES_UI = \

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

# --------------------------------------------------------------
# Files to build (VCV stuff)
@@ -50,107 +50,26 @@ FILES_DSP += $(wildcard Rack/src/*/*.c)
FILES_DSP += $(filter-out Rack/src/dep.cpp Rack/src/discord.cpp Rack/src/gamepad.cpp Rack/src/keyboard.cpp Rack/src/library.cpp Rack/src/network.cpp Rack/src/rtaudio.cpp Rack/src/rtmidi.cpp, $(wildcard Rack/src/*.cpp))
FILES_DSP += $(filter-out Rack/src/window/Window.cpp, $(wildcard Rack/src/*/*.cpp))

EXTRA_DEPENDENCIES += Rack/dep/lib/libjansson.a
EXTRA_DEPENDENCIES += Rack/dep/lib/libspeexdsp.a

ifeq ($(WINDOWS),true)
EXTRA_DEPENDENCIES += Rack/dep/lib/libarchive_static.a
else
EXTRA_DEPENDENCIES += Rack/dep/lib/libarchive.a
endif

EXTRA_DEPENDENCIES += Rack/dep/lib/libzstd.a

EXTRA_LIBS = $(EXTRA_DEPENDENCIES)

# --------------------------------------------------------------
# Do some magic

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

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

DEP_PATH = $(abspath Rack/dep)

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
else
MACHINE = $(TARGET_MACHINE)
endif

ifneq ($(MACOS_OR_WINDOWS),true)
MACHINE_SUFFIX = -linux
endif

# NOTE speex fails to build when neon is enabled
CONFIGURE = ./configure --prefix="$(DEP_PATH)" --host=$(TARGET_MACHINE) --enable-neon=no

# --------------------------------------------------------------
# Fix up cmake

SPACE =
SPACE +=

CMAKE = cmake

ifneq (,$(findstring -arch$(SPACE),$(CXXFLAGS)))
CMAKE += -DCMAKE_OSX_ARCHITECTURES='$(subst $(SPACE),;,$(subst -arch=,,$(filter -arch=%,$(subst -arch$(SPACE),-arch=,$(CXXFLAGS)))))'
endif
ifneq (,$(findstring -mmacosx-version-min=,$(CXXFLAGS)))
CMAKE += -DCMAKE_OSX_DEPLOYMENT_TARGET=$(subst -mmacosx-version-min=,,$(filter -mmacosx-version-min=%,$(CXXFLAGS)))
endif
# Extra libraries to link against

EXTRA_LIBS = ../plugins/plugins.a
EXTRA_LIBS += Rack/dep/lib/libjansson.a
EXTRA_LIBS += Rack/dep/lib/libsamplerate.a
EXTRA_LIBS += Rack/dep/lib/libspeexdsp.a
ifeq ($(WINDOWS),true)
CMAKE += -G 'Unix Makefiles'
CMAKE += -DCMAKE_RC_COMPILER=$(subst gcc,windres,$(CC))
CMAKE += -DCMAKE_SYSTEM_NAME=Windows
endif

ifeq ($(DEBUG),true)
CMAKE += -DCMAKE_BUILD_TYPE=Debug
EXTRA_LIBS += Rack/dep/lib/libarchive_static.a
else
CMAKE += -DCMAKE_BUILD_TYPE=Release
EXTRA_LIBS += Rack/dep/lib/libarchive.a
endif

CMAKE += -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX='$(DEP_PATH)'
EXTRA_LIBS += Rack/dep/lib/libzstd.a

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

Rack/dep/lib/%.a:
$(MAKE) \
ARCH_NAME=$(ARCH_NAME) \
CFLAGS="$(BUILD_C_FLAGS)" \
CXXFLAGS="$(BUILD_CXX_FLAGS)" \
LDFLAGS="$(LINK_FLAGS)" \
CMAKE="$(CMAKE)" \
CONFIGURE="$(CONFIGURE)" \
DEP_FLAGS="$(BASE_FLAGS)" \
DEP_MAC_SDK_FLAGS= \
MACHINE=$(MACHINE)$(MACHINE_SUFFIX) \
-C Rack/dep lib/$*.a

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

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

ifeq ($(MACOS),true)
# zstd cmake is borked, see https://github.com/facebook/zstd/issues/1401
Rack/dep/lib/libzstd.a: Rack/dep/zstd-1.4.5/.stamp-patched
# Do some magic

Rack/dep/zstd-1.4.5/.stamp-patched:
$(MAKE) -C Rack/dep zstd-1.4.5
sed -i -e "56,66d" Rack/dep/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
touch $@
endif
DPF_PATH = ../dpf
DPF_TARGET_DIR = ../bin
include ../dpf/Makefile.plugins.mk

# --------------------------------------------------------------
# Extra flags for VCV stuff
@@ -163,18 +82,8 @@ 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 += -I../dpf/dgl/src/nanovg
BASE_FLAGS += -IRack/include
BASE_FLAGS += -IRack/dep/include
BASE_FLAGS += -IRack/dep/filesystem/include
@@ -184,20 +93,25 @@ 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

BASE_FLAGS += -Ineon-compat
BASE_FLAGS += -pthread

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

BUILD_C_FLAGS += -std=gnu11

# --------------------------------------------------------------
# FIXME lots of warnings from VCV side

BASE_FLAGS += -Wno-unused-parameter
BASE_FLAGS += -Wno-unused-variable

# --------------------------------------------------------------
# extra linker flags

ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
LINK_FLAGS += -ldl
endif
@@ -209,10 +123,19 @@ LINK_FLAGS += -ldbghelp -lshlwapi
endif

# --------------------------------------------------------------
# Enable all possible plugin types
# temporary macro just to get the ball rolling

ifeq ($(EXE_WRAPPER),wine)
SOURCE_DIR = Z:$(subst /,\\,$(CURDIR))
else
SOURCE_DIR = $(CURDIR)
endif

TARGETS = jack lv2 vst2 vst3
BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_SOURCE_DIR='"$(SOURCE_DIR)"'

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

all: $(TARGETS)
all: jack lv2 vst2 vst3

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

+ 1
- 0
src/Rack

@@ -0,0 +1 @@
Subproject commit 420e781fa7bfdcf47163ab1fa976c171c91cb92b

plugins/Cardinal/ResizeHandle.hpp → src/ResizeHandle.hpp View File


plugins/Cardinal/Window.cpp → src/Window.cpp View File

@@ -17,6 +17,7 @@
#ifdef NDEBUG
# undef DEBUG
#endif

#include "DistrhoUI.hpp"

namespace rack {

plugins/Cardinal/dep.cpp → src/dep.cpp View File

@@ -7,8 +7,14 @@
#endif
#include "OpenGL.hpp"

#define BLENDISH_IMPLEMENTATION
#include <blendish.h>
#ifdef DEBUG
// fix blendish build, missing symbol in debug mode
extern "C" {
float bnd_clamp(float v, float mn, float mx) {
return (v > mx)?mx:(v < mn)?mn:v;
}
}
#endif

#define NANOSVG_IMPLEMENTATION
#define NANOSVG_ALL_COLOR_KEYWORDS

plugins/Cardinal/mingw-compat/Shlobj.h → src/mingw-compat/Shlobj.h View File


plugins/Cardinal/mingw-compat/Shlwapi.h → src/mingw-compat/Shlwapi.h View File


plugins/Cardinal/mingw-compat/Windows.h → src/mingw-compat/Windows.h View File


plugins/Cardinal/mingw-compat/condition_variable → src/mingw-compat/condition_variable View File


plugins/Cardinal/mingw-compat/mutex → src/mingw-compat/mutex View File


plugins/Cardinal/mingw-compat/thread → src/mingw-compat/thread View File


plugins/Cardinal/mingw-std-threads → src/mingw-std-threads View File


plugins/Cardinal/neon-compat/pmmintrin.h → src/neon-compat/pmmintrin.h View File


plugins/Cardinal/sse2neon → src/sse2neon View File


Loading…
Cancel
Save