Skip to content

Commit

Permalink
Conditional compilation for libgw
Browse files Browse the repository at this point in the history
  • Loading branch information
kcleal committed Oct 17, 2024
1 parent f6f3de2 commit 3de7dfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/plot_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -362,7 +364,7 @@ namespace Manager {
if (rasterSurfacePtr == nullptr) {
makeRasterSurface();
}

#endif
}

void GwPlot::initBack(int width, int height) {
Expand Down

0 comments on commit 3de7dfb

Please sign in to comment.