From 412f0dd3f6bcc9ac2b579ae6bab4ba3e19a73dcb Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 10 Nov 2017 19:16:29 +0000 Subject: [PATCH] Build DPF with sofd disabled, not used for any plugins so far --- source/Makefile.mk | 4 ++++ source/modules/dgl/Makefile | 5 +---- source/modules/dgl/Window.hpp | 6 ++++++ source/modules/dgl/src/Window.cpp | 8 ++++++++ source/modules/dgl/src/pugl/pugl_osx.m | 3 +++ source/modules/dgl/src/pugl/pugl_x11.c | 2 ++ 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/source/Makefile.mk b/source/Makefile.mk index 1a3c3d9ba..d4eaacff3 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -127,6 +127,10 @@ ifneq ($(MACOS),true) LINK_FLAGS += -Wl,--no-undefined endif +ifeq ($(MACOS_OLD),true) +BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) +endif + # -------------------------------------------------------------- # Strict test build diff --git a/source/modules/dgl/Makefile b/source/modules/dgl/Makefile index 4ffe22cdf..5c14445f2 100644 --- a/source/modules/dgl/Makefile +++ b/source/modules/dgl/Makefile @@ -10,10 +10,7 @@ include ../Makefile.mk # ---------------------------------------------------------------------------------------------------------------------------- -BUILD_CXX_FLAGS += $(DGL_FLAGS) -Isrc - -# needed by sofd right now, fix later -BUILD_CXX_FLAGS += -Wno-type-limits -fpermissive +BUILD_CXX_FLAGS += $(DGL_FLAGS) -DDGL_FILE_BROWSER_DISABLED -Isrc # ---------------------------------------------------------------------------------------------------------------------------- diff --git a/source/modules/dgl/Window.hpp b/source/modules/dgl/Window.hpp index 25fa9b27e..8673dc7e1 100644 --- a/source/modules/dgl/Window.hpp +++ b/source/modules/dgl/Window.hpp @@ -30,6 +30,7 @@ class StandaloneWindow; class Window { public: +#ifndef DGL_FILE_BROWSER_DISABLED /** File browser options. */ @@ -66,6 +67,7 @@ public: height(0), buttons() {} }; +#endif // DGL_FILE_BROWSER_DISABLED explicit Window(Application& app); explicit Window(Application& app, Window& parent); @@ -80,7 +82,9 @@ public: void focus(); void repaint() noexcept; +#ifndef DGL_FILE_BROWSER_DISABLED bool openFileBrowser(const FileBrowserOptions& options); +#endif bool isVisible() const noexcept; void setVisible(bool yesNo); @@ -111,7 +115,9 @@ protected: virtual void onReshape(uint width, uint height); virtual void onClose(); +#ifndef DGL_FILE_BROWSER_DISABLED virtual void fileBrowserSelected(const char* filename); +#endif private: struct PrivateData; diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index 5de0a30e1..a3cdea3e7 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -207,7 +207,9 @@ struct Window::PrivateData { puglSetSpecialFunc(fView, onSpecialCallback); puglSetReshapeFunc(fView, onReshapeCallback); puglSetCloseFunc(fView, onCloseCallback); +#ifndef DGL_FILE_BROWSER_DISABLED puglSetFileSelectedFunc(fView, fileBrowserSelectedCallback); +#endif puglCreateWindow(fView, nullptr); @@ -949,10 +951,12 @@ struct Window::PrivateData { handlePtr->onPuglClose(); } +#ifndef DGL_FILE_BROWSER_DISABLED static void fileBrowserSelectedCallback(PuglView* view, const char* filename) { handlePtr->fSelf->fileBrowserSelected(filename); } +#endif #undef handlePtr @@ -1012,6 +1016,7 @@ void Window::repaint() noexcept // (void)name; // } +#ifndef DGL_FILE_BROWSER_DISABLED bool Window::openFileBrowser(const FileBrowserOptions& options) { #ifdef SOFD_HAVE_X11 @@ -1077,6 +1082,7 @@ bool Window::openFileBrowser(const FileBrowserOptions& options) return false; #endif } +#endif bool Window::isVisible() const noexcept { @@ -1207,9 +1213,11 @@ void Window::onClose() { } +#ifndef DGL_FILE_BROWSER_DISABLED void Window::fileBrowserSelected(const char*) { } +#endif // ----------------------------------------------------------------------- diff --git a/source/modules/dgl/src/pugl/pugl_osx.m b/source/modules/dgl/src/pugl/pugl_osx.m index 5909d67e9..bcd11678a 100644 --- a/source/modules/dgl/src/pugl/pugl_osx.m +++ b/source/modules/dgl/src/pugl/pugl_osx.m @@ -570,4 +570,7 @@ void* puglGetContext(PuglView* view) { return NULL; + + // unused + (void)view; } diff --git a/source/modules/dgl/src/pugl/pugl_x11.c b/source/modules/dgl/src/pugl/pugl_x11.c index 60be55e70..b8802c20b 100644 --- a/source/modules/dgl/src/pugl/pugl_x11.c +++ b/source/modules/dgl/src/pugl/pugl_x11.c @@ -41,9 +41,11 @@ #include "pugl/pugl_internal.h" +#ifndef DGL_FILE_BROWSER_DISABLED #define SOFD_HAVE_X11 #include "../sofd/libsofd.h" #include "../sofd/libsofd.c" +#endif struct PuglInternalsImpl { Display* display;