From 3de7dfb46e7b0c0c84b5f9d339c7a11da0e26248 Mon Sep 17 00:00:00 2001 From: kcleal Date: Thu, 17 Oct 2024 15:36:38 +0100 Subject: [PATCH] Conditional compilation for libgw --- Makefile | 6 +++--- src/plot_manager.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index de44aca..9ce94e1 100644 --- a/Makefile +++ b/Makefile @@ -146,14 +146,14 @@ ifeq ($(UNAME_S),Darwin) SHARED_TARGET = libgw.dylib endif -shared: CXXFLAGS += -fPIC -DBUILDING_LIBGW -DGLAD_GLAPI_EXPORT_BUILD +shared: CXXFLAGS += -fPIC -DBUILDING_LIBGW shared: CFLAGS += -fPIC shared: $(OBJECTS) ifeq ($(UNAME_S),Darwin) - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -dynamiclib -DBUILDING_LIBGW -DGLAD_GLAPI_EXPORT_BUILD -o $(SHARED_TARGET) + $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -dynamiclib -DBUILDING_LIBGW -o $(SHARED_TARGET) else - $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -shared -DBUILDING_LIBGW -DGLAD_GLAPI_EXPORT_BUILD -o $(SHARED_TARGET) + $(CXX) $(OBJECTS) $(LDFLAGS) $(LDLIBS) -shared -DBUILDING_LIBGW -o $(SHARED_TARGET) endif -mkdir -p include/libgw lib/libgw -cp $(SKIA_PATH)/libskia.a lib/libgw diff --git a/src/plot_manager.cpp b/src/plot_manager.cpp index 0497777..d81e0d0 100644 --- a/src/plot_manager.cpp +++ b/src/plot_manager.cpp @@ -192,7 +192,9 @@ namespace Manager { } void GwPlot::init(int width, int height) { - +#ifdef BUILDING_LIBGW + std::cerr << "Error: init not supported for libgw\n"; +#else this->fb_width = 0; this->fb_height = 0; @@ -362,7 +364,7 @@ namespace Manager { if (rasterSurfacePtr == nullptr) { makeRasterSurface(); } - +#endif } void GwPlot::initBack(int width, int height) {