Skip to content

Commit 8722584

Browse files
committed
Update dpf
Signed-off-by: falkTX <falktx@falktx.com>
1 parent 8ebc9e3 commit 8722584

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4708
-5303
lines changed

dpf/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if(DPF_LIBRARIES)
3232
find_package(PkgConfig)
3333
if(PKG_CONFIG_FOUND)
3434
pkg_check_modules(CAIRO "cairo")
35-
if(CAIRO_FOUND)
35+
if(CAIRO_FOUND AND (NOT HAIKU))
3636
dpf__add_dgl_cairo(FALSE)
3737
endif()
3838
endif()
@@ -43,11 +43,14 @@ if(DPF_EXAMPLES)
4343
find_package(PkgConfig)
4444
if(PKG_CONFIG_FOUND)
4545
pkg_check_modules(CAIRO "cairo")
46-
if(CAIRO_FOUND)
46+
if(CAIRO_FOUND AND (NOT HAIKU))
4747
add_subdirectory("examples/CairoUI")
4848
endif()
4949
endif()
50-
#add_subdirectory("examples/ExternalUI")
50+
if((NOT WIN32) AND (NOT APPLE))
51+
add_subdirectory("examples/ExternalUI")
52+
endif()
53+
add_subdirectory("examples/EmbedExternalUI")
5154
add_subdirectory("examples/FileHandling")
5255
add_subdirectory("examples/Info")
5356
add_subdirectory("examples/Latency")

dpf/Makefile.base.mk

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ DPF_MAKEFILE_BASE_INCLUDED = true
3535
# ---------------------------------------------------------------------------------------------------------------------
3636
# Auto-detect target compiler if not defined
3737

38-
ifeq ($(shell echo '\#test' | grep -- '\#test'),\#test)
38+
ifneq ($(shell echo -e escaped-by-default | grep -- '-e escaped-by-default'),-e escaped-by-default)
39+
TARGET_COMPILER = $(shell echo -e '#ifdef __clang__\nclang\n#else\ngcc\n#endif' | $(CC) -E -P -x c - 2>/dev/null)
40+
else ifeq ($(shell echo '\#escaped-by-default' | grep -- '\#escaped-by-default'),\#escaped-by-default)
3941
TARGET_COMPILER = $(shell echo '\#ifdef __clang__\nclang\n\#else\ngcc\n\#endif' | $(CC) -E -P -x c - 2>/dev/null)
4042
else
4143
TARGET_COMPILER = $(shell echo '#ifdef __clang__\nclang\n#else\ngcc\n#endif' | $(CC) -E -P -x c - 2>/dev/null)
@@ -272,7 +274,10 @@ BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
272274
endif
273275

274276
ifeq ($(DEBUG),true)
275-
BASE_FLAGS += -DDEBUG -O0 -g -fsanitize=address
277+
BASE_FLAGS += -DDEBUG -O0 -g
278+
ifneq ($(HAIKU),true)
279+
BASE_FLAGS += -fsanitize=address
280+
endif
276281
LINK_OPTS =
277282
ifeq ($(WASM),true)
278283
LINK_OPTS += -sASSERTIONS=1
@@ -347,9 +352,11 @@ endif
347352
# ---------------------------------------------------------------------------------------------------------------------
348353
# Check for required libraries
349354

350-
HAVE_CAIRO = $(shell $(PKG_CONFIG) --exists cairo && echo true)
355+
ifneq ($(HAIKU),true)
356+
HAVE_CAIRO = $(shell $(PKG_CONFIG) --exists cairo && echo true)
357+
endif
351358

352-
ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
359+
ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS),true)
353360
HAVE_OPENGL = true
354361
else
355362
HAVE_OPENGL = $(shell $(PKG_CONFIG) --exists gl && echo true)
@@ -402,18 +409,34 @@ endif
402409
# Set Generic DGL stuff
403410

404411
ifeq ($(HAIKU),true)
412+
405413
DGL_SYSTEM_LIBS += -lbe
414+
406415
else ifeq ($(MACOS),true)
407-
DGL_SYSTEM_LIBS += -framework Cocoa -framework CoreVideo
416+
417+
DGL_SYSTEM_LIBS += -framework Cocoa
418+
DGL_SYSTEM_LIBS += -framework CoreVideo
419+
408420
else ifeq ($(WASM),true)
421+
422+
# wasm builds cannot work using regular desktop OpenGL
423+
ifeq (,$(USE_GLES2)$(USE_GLES3))
424+
USE_GLES2 = true
425+
endif
426+
409427
else ifeq ($(WINDOWS),true)
410-
DGL_SYSTEM_LIBS += -lgdi32 -lcomdlg32
411-
# -lole32
428+
429+
DGL_SYSTEM_LIBS += -lcomdlg32
430+
DGL_SYSTEM_LIBS += -lgdi32
431+
# DGL_SYSTEM_LIBS += -lole32
432+
412433
else
434+
413435
ifeq ($(HAVE_DBUS),true)
414436
DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags dbus-1) -DHAVE_DBUS
415437
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs dbus-1)
416438
endif
439+
417440
ifeq ($(HAVE_X11),true)
418441
DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags x11) -DHAVE_X11
419442
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs x11)
@@ -429,7 +452,8 @@ ifeq ($(HAVE_XRANDR),true)
429452
DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags xrandr) -DHAVE_XRANDR
430453
DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs xrandr)
431454
endif
432-
endif
455+
endif # HAVE_X11
456+
433457
endif
434458

435459
# ---------------------------------------------------------------------------------------------------------------------
@@ -444,7 +468,7 @@ CAIRO_LIBS = $(shell $(PKG_CONFIG) --libs cairo)
444468

445469
HAVE_CAIRO_OR_OPENGL = true
446470

447-
endif
471+
endif # HAVE_CAIRO
448472

449473
# ---------------------------------------------------------------------------------------------------------------------
450474
# Set OpenGL specific stuff
@@ -454,8 +478,8 @@ ifeq ($(HAVE_OPENGL),true)
454478
DGL_FLAGS += -DHAVE_OPENGL
455479

456480
ifeq ($(HAIKU),true)
457-
OPENGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl)
458-
OPENGL_LIBS = $(shell $(PKG_CONFIG) --libs gl)
481+
OPENGL_FLAGS =
482+
OPENGL_LIBS = -lGL
459483
else ifeq ($(MACOS),true)
460484
OPENGL_FLAGS = -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
461485
OPENGL_LIBS = -framework OpenGL
@@ -476,12 +500,12 @@ endif
476500

477501
HAVE_CAIRO_OR_OPENGL = true
478502

479-
endif
503+
endif # HAVE_OPENGL
480504

481505
# ---------------------------------------------------------------------------------------------------------------------
482506
# Set Stub specific stuff
483507

484-
ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
508+
ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS),true)
485509
HAVE_STUB = true
486510
else
487511
HAVE_STUB = $(HAVE_X11)
@@ -540,7 +564,7 @@ endif
540564
# ---------------------------------------------------------------------------------------------------------------------
541565
# Backwards-compatible HAVE_DGL
542566

543-
ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
567+
ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS),true)
544568
HAVE_DGL = true
545569
else ifeq ($(HAVE_OPENGL),true)
546570
HAVE_DGL = $(HAVE_X11)
@@ -633,6 +657,41 @@ else
633657
SHARED = -shared
634658
endif
635659

660+
# ---------------------------------------------------------------------------------------------------------------------
661+
# Set CLAP binary directory
662+
663+
ifeq ($(MACOS),true)
664+
CLAP_BINARY_DIR = Contents/MacOS
665+
else
666+
CLAP_BINARY_DIR =
667+
endif
668+
669+
# ---------------------------------------------------------------------------------------------------------------------
670+
# Set VST2 binary directory
671+
672+
ifeq ($(MACOS),true)
673+
VST2_BINARY_DIR = Contents/MacOS
674+
else
675+
VST2_BINARY_DIR =
676+
endif
677+
678+
# ---------------------------------------------------------------------------------------------------------------------
679+
# Set VST3 binary directory, see https://vst3sdk-doc.diatonic.jp/doc/vstinterfaces/vst3loc.html
680+
681+
ifeq ($(LINUX),true)
682+
VST3_BINARY_DIR = Contents/$(TARGET_PROCESSOR)-linux
683+
else ifeq ($(MACOS),true)
684+
VST3_BINARY_DIR = Contents/MacOS
685+
else ifeq ($(WASM),true)
686+
VST3_BINARY_DIR = Contents/wasm
687+
else ifeq ($(WINDOWS)$(CPU_I386),truetrue)
688+
VST3_BINARY_DIR = Contents/x86-win
689+
else ifeq ($(WINDOWS)$(CPU_X86_64),truetrue)
690+
VST3_BINARY_DIR = Contents/x86_64-win
691+
else
692+
VST3_BINARY_DIR =
693+
endif
694+
636695
# ---------------------------------------------------------------------------------------------------------------------
637696
# Handle the verbosity switch
638697

@@ -713,6 +772,7 @@ MOD_ENVIRONMENT = \
713772
CXX=${1}/host/usr/bin/${2}-g++ \
714773
LD=${1}/host/usr/bin/${2}-ld \
715774
PKG_CONFIG=${1}/host/usr/bin/pkg-config \
775+
PKG_CONFIG_PATH="${1}/staging/usr/lib/pkgconfig" \
716776
STRIP=${1}/host/usr/bin/${2}-strip \
717777
CFLAGS="-I${1}/staging/usr/include $(EXTRA_MOD_FLAGS)" \
718778
CPPFLAGS= \
@@ -738,12 +798,12 @@ modpush:
738798

739799
ifneq (,$(findstring modduo-,$(MAKECMDGOALS)))
740800
$(MAKECMDGOALS):
741-
$(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduo,arm-mod-linux-gnueabihf,arm) $(subst modduo-,,$(MAKECMDGOALS))
801+
$(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduo-static,arm-mod-linux-gnueabihf.static,arm) $(subst modduo-,,$(MAKECMDGOALS))
742802
endif
743803

744804
ifneq (,$(findstring modduox-,$(MAKECMDGOALS)))
745805
$(MAKECMDGOALS):
746-
$(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduox,aarch64-mod-linux-gnueabi,aarch64) $(subst modduox-,,$(MAKECMDGOALS))
806+
$(MAKE) $(call MOD_ENVIRONMENT,$(MOD_WORKDIR)/modduox-static,aarch64-mod-linux-gnueabi.static,aarch64) $(subst modduox-,,$(MAKECMDGOALS))
747807
endif
748808

749809
ifneq (,$(findstring moddwarf-,$(MAKECMDGOALS)))

0 commit comments

Comments
 (0)