Fix SYSDEPS build

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-11-08 16:35:32 +00:00
parent fe3043783d
commit 34e3c0f782
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
5 changed files with 20 additions and 4 deletions

View file

@ -23,10 +23,12 @@
#include "water/streams/MemoryOutputStream.h" #include "water/streams/MemoryOutputStream.h"
#include "water/xml/XmlDocument.h" #include "water/xml/XmlDocument.h"
extern "C" { #ifndef CARDINAL_SYSDEPS
// private method that takes ownership, we can use it to avoid superfulous allocations // private method that takes ownership, we can use it to avoid superfulous allocations
extern "C" {
json_t *jsonp_stringn_nocheck_own(const char* value, size_t len); json_t *jsonp_stringn_nocheck_own(const char* value, size_t len);
} }
#endif
#define BUFFER_SIZE 128 #define BUFFER_SIZE 128
@ -245,7 +247,11 @@ struct CarlaModule : Module {
engine->saveProjectInternal(projectState); engine->saveProjectInternal(projectState);
const size_t dataSize = projectState.getDataSize(); const size_t dataSize = projectState.getDataSize();
#ifndef CARDINAL_SYSDEPS
return jsonp_stringn_nocheck_own(static_cast<const char*>(projectState.getDataAndRelease()), dataSize); return jsonp_stringn_nocheck_own(static_cast<const char*>(projectState.getDataAndRelease()), dataSize);
#else
return json_stringn(static_cast<const char*>(projectState.getData()), dataSize);
#endif
} }
void dataFromJson(json_t* const rootJ) override void dataFromJson(json_t* const rootJ) override

View file

@ -26,10 +26,12 @@
#include "water/streams/MemoryOutputStream.h" #include "water/streams/MemoryOutputStream.h"
#include "water/xml/XmlDocument.h" #include "water/xml/XmlDocument.h"
extern "C" { #ifndef CARDINAL_SYSDEPS
// private method that takes ownership, we can use it to avoid superfulous allocations // private method that takes ownership, we can use it to avoid superfulous allocations
extern "C" {
json_t *jsonp_stringn_nocheck_own(const char* value, size_t len); json_t *jsonp_stringn_nocheck_own(const char* value, size_t len);
} }
#endif
#define BUFFER_SIZE 128 #define BUFFER_SIZE 128
@ -237,7 +239,11 @@ struct IldaeilModule : Module {
engine->saveProjectInternal(projectState); engine->saveProjectInternal(projectState);
const size_t dataSize = projectState.getDataSize(); const size_t dataSize = projectState.getDataSize();
#ifndef CARDINAL_SYSDEPS
return jsonp_stringn_nocheck_own(static_cast<const char*>(projectState.getDataAndRelease()), dataSize); return jsonp_stringn_nocheck_own(static_cast<const char*>(projectState.getDataAndRelease()), dataSize);
#else
return json_stringn(static_cast<const char*>(projectState.getData()), dataSize);
#endif
} }
void dataFromJson(json_t* const rootJ) override void dataFromJson(json_t* const rootJ) override

View file

@ -531,7 +531,9 @@ BASE_FLAGS += -I../src/Rack/dep/oui-blendish
BASE_FLAGS += -I../src/Rack/dep/pffft BASE_FLAGS += -I../src/Rack/dep/pffft
BASE_FLAGS += -pthread BASE_FLAGS += -pthread
ifneq ($(SYSDEPS),true) ifeq ($(SYSDEPS),true)
BASE_FLAGS += -DCARDINAL_SYSDEPS
else
BASE_FLAGS += -DZSTDLIB_VISIBILITY= BASE_FLAGS += -DZSTDLIB_VISIBILITY=
BASE_FLAGS += -I../src/Rack/dep/include BASE_FLAGS += -I../src/Rack/dep/include
endif endif

View file

@ -36,6 +36,7 @@ BASE_FLAGS += -I../include
BASE_FLAGS += -I../include/neon-compat BASE_FLAGS += -I../include/neon-compat
BASE_FLAGS += -IRack/include BASE_FLAGS += -IRack/include
ifeq ($(SYSDEPS),true) ifeq ($(SYSDEPS),true)
BASE_FLAGS += -DCARDINAL_SYSDEPS
BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp) BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp)
else else
BASE_FLAGS += -DZSTDLIB_VISIBILITY= BASE_FLAGS += -DZSTDLIB_VISIBILITY=

View file

@ -133,9 +133,10 @@ BASE_FLAGS += -I../../include
BASE_FLAGS += -I../../include/neon-compat BASE_FLAGS += -I../../include/neon-compat
BASE_FLAGS += -I../Rack/include BASE_FLAGS += -I../Rack/include
ifeq ($(SYSDEPS),true) ifeq ($(SYSDEPS),true)
BASE_FLAGS += -DZSTDLIB_VISIBILITY= BASE_FLAGS += -DCARDINAL_SYSDEPS
BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp) BASE_FLAGS += $(shell pkg-config --cflags jansson libarchive samplerate speexdsp)
else else
BASE_FLAGS += -DZSTDLIB_VISIBILITY=
BASE_FLAGS += -I../Rack/dep/include BASE_FLAGS += -I../Rack/dep/include
endif endif
BASE_FLAGS += -I../Rack/dep/glfw/include BASE_FLAGS += -I../Rack/dep/glfw/include