From b0878b7273d9b73d084bb5cf81676823ca3dec96 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 11 Aug 2024 12:55:21 +0200 Subject: [PATCH] Fix macOS build Signed-off-by: falkTX --- source/Makefile.deps.mk | 11 +++++++++-- source/backend/utils/Makefile | 3 ++- source/bridges-plugin/Makefile | 1 + source/plugin/Makefile | 14 ++------------ source/theme/Makefile | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/source/Makefile.deps.mk b/source/Makefile.deps.mk index f1f4de7c8..3967dbc26 100644 --- a/source/Makefile.deps.mk +++ b/source/Makefile.deps.mk @@ -216,6 +216,7 @@ HAVE_QT5 = $(shell $(PKG_CONFIG) --exists Qt5Core Qt5Gui Qt5Widgets && \ HAVE_QT5PKG = $(shell $(PKG_CONFIG) --silence-errors --variable=prefix Qt5OpenGLExtensions 1>/dev/null && echo true) HAVE_QT5BREW = $(shell test -e /usr/local/opt/qt5/bin/uic && echo true) HAVE_QT6 = $(shell $(PKG_CONFIG) --exists Qt6Core Qt6Gui Qt6Widgets && echo true) +HAVE_QT6BREW = $(shell test -e /opt/homebrew/opt/qt6/share/qt/libexec/uic && echo true) HAVE_SNDFILE = $(shell $(PKG_CONFIG) --exists sndfile && echo true) ifeq ($(HAVE_FLUIDSYNTH),true) @@ -297,6 +298,12 @@ QT6_PREFIX = $(shell $(PKG_CONFIG) --variable=prefix Qt6Core) QT6_CXX_FLAGS = $(shell $(PKG_CONFIG) --cflags Qt6Core Qt6Gui Qt6Widgets) -std=gnu++17 QT6_LINK_FLAGS = -Wl,-rpath,$(QT6_PREFIX)/lib $(shell $(PKG_CONFIG) --libs Qt6Core Qt6Gui Qt6Widgets) QT6_STYLES_DIR = $(shell pkg-config --variable=libdir Qt6Core)/qt6/plugins/styles +else ifeq ($(HAVE_QT6BREW),true) +QT6_HOSTBINS = /opt/homebrew/opt/qt6/share/qt/libexec +QT6_PREFIX = /opt/homebrew/opt/qt6 +QT6_CXX_FLAGS = -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I $(QT6_PREFIX)/include -std=gnu++17 +QT6_LINK_FLAGS = -Wl,-rpath,$(QT6_PREFIX)/lib -F $(QT6_PREFIX)/lib -framework QtCore -framework QtGui -framework QtWidgets +QT6_STYLES_DIR = $(QT6_PREFIX)/share/qt/plugins/styles endif MOC_QT5 ?= $(QT5_HOSTBINS)/moc @@ -342,7 +349,7 @@ PYUIC5 ?= $(shell which pyuic5 2>/dev/null) PYUIC6 ?= $(shell which pyuic6 2>/dev/null) -ifeq ($(HAVE_QT6),true) +ifneq (,$(findstring true,$(HAVE_QT6)$(HAVE_QT6BREW))) ifneq ($(PYUIC6),) HAVE_FRONTEND = true HAVE_PYQT = true @@ -369,7 +376,7 @@ endif # --------------------------------------------------------------------------------------------------------------------- # Set Qt tools, part2 -ifneq (,$(findstring true,$(HAVE_QT4)$(HAVE_QT5)$(HAVE_QT5PKG)$(HAVE_QT5BREW)$(HAVE_QT6))) +ifneq (,$(findstring true,$(HAVE_QT4)$(HAVE_QT5)$(HAVE_QT5PKG)$(HAVE_QT5BREW)$(HAVE_QT6)$(HAVE_QT6BREW))) HAVE_QT = true endif diff --git a/source/backend/utils/Makefile b/source/backend/utils/Makefile index c629860f6..08c765327 100644 --- a/source/backend/utils/Makefile +++ b/source/backend/utils/Makefile @@ -10,7 +10,7 @@ include ../Makefile.mk # --------------------------------------------------------------------------------------------------------------------- BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS) -BUILD_CXX_FLAGS += $(MAGIC_LIBS) +BUILD_CXX_FLAGS += $(MAGIC_FLAGS) BUILD_CXX_FLAGS += $(YSFX_FLAGS) # --------------------------------------------------------------------------------------------------------------------- @@ -38,6 +38,7 @@ endif LINK_FLAGS += $(JACKBRIDGE_LIBS) LINK_FLAGS += $(LILV_LIBS) +LINK_FLAGS += $(MAGIC_LIBS) LINK_FLAGS += $(WATER_LIBS) ifeq ($(HAVE_X11),true) diff --git a/source/bridges-plugin/Makefile b/source/bridges-plugin/Makefile index 45afdf1eb..1b6431752 100644 --- a/source/bridges-plugin/Makefile +++ b/source/bridges-plugin/Makefile @@ -99,6 +99,7 @@ NATIVE_LINK_FLAGS += $(LIBLO_LIBS) NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS) NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS) +NATIVE_BUILD_FLAGS += $(MAGIC_FLAGS) NATIVE_LINK_FLAGS += $(MAGIC_LIBS) LIBS_native += $(MODULEDIR)/audio_decoder.a diff --git a/source/plugin/Makefile b/source/plugin/Makefile index 63b989fd3..1b4017ead 100644 --- a/source/plugin/Makefile +++ b/source/plugin/Makefile @@ -35,21 +35,11 @@ endif BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils BUILD_CXX_FLAGS += $(NATIVE_PLUGINS_FLAGS) -ifeq ($(HAVE_LIBLO),true) -BUILD_CXX_FLAGS += $(LIBLO_FLAGS) -endif - -ifeq ($(HAVE_FLUIDSYNTH),true) BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS) -endif - -ifeq ($(HAVE_X11),true) +BUILD_CXX_FLAGS += $(LIBLO_FLAGS) +BUILD_CXX_FLAGS += $(MAGIC_FLAGS) BUILD_CXX_FLAGS += $(X11_FLAGS) -endif - -ifeq ($(HAVE_YSFX),true) BUILD_CXX_FLAGS += $(YSFX_FLAGS) -endif # --------------------------------------------------------------------------------------------------------------------- # Libs diff --git a/source/theme/Makefile b/source/theme/Makefile index 7f375824f..7079b39ed 100644 --- a/source/theme/Makefile +++ b/source/theme/Makefile @@ -34,7 +34,7 @@ OBJS_qt4 = \ $(OBJDIR)/resources.qt4.cpp.o endif -ifeq ($(HAVE_QT5),true) +ifneq (,$(findstring true,$(HAVE_QT5)$(HAVE_QT5PKG)$(HAVE_QT5BREW))) FILES_qt5 = \ $(OBJDIR)/moc_CarlaStyle.qt5.cpp \ $(OBJDIR)/moc_CarlaStyleAnimations.qt5.cpp \ @@ -50,7 +50,7 @@ OBJS_qt5 = \ $(OBJDIR)/resources.qt5.cpp.o endif -ifeq ($(HAVE_QT6),true) +ifneq (,$(findstring true,$(HAVE_QT6)$(HAVE_QT6BREW))) FILES_qt6 = \ $(OBJDIR)/moc_CarlaStyle.qt6.cpp \ $(OBJDIR)/moc_CarlaStyleAnimations.qt6.cpp \