Skip to content

Commit

Permalink
Fix Leptonica/ZXing header clash.
Browse files Browse the repository at this point in the history
We had the leptonica and tesseract cflags rolled into the
generic THIRD_CFLAGS macro, which meant they were used in
more places than required. The lead to a clash between
almost identically named header files.

The fix is to remove the leptonica and tesseract cflags
from THIRD_CFLAGS and just use them exactly where required.
  • Loading branch information
robinwatts committed Feb 18, 2025
1 parent b7fe2e0 commit b2d0556
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ $(OUT)/source/%.o : source/%.cpp

ifeq ($(HAVE_TESSERACT),yes)
$(OUT)/source/fitz/tessocr.o : source/fitz/tessocr.cpp
$(CXX_CMD) $(WARNING_CFLAGS) $(LIB_CFLAGS) $(THIRD_CFLAGS) $(TESSERACT_CFLAGS) $(TESSERACT_DEFINES) $(TESSERACT_LANGFLAGS)
$(CXX_CMD) $(WARNING_CFLAGS) $(LIB_CFLAGS) $(THIRD_CFLAGS) $(TESSERACT_CFLAGS) $(TESSERACT_DEFINES) $(TESSERACT_LANGFLAGS) $(LEPTONICA_CFLAGS)
endif

ifeq ($(HAVE_LEPTONICA),yes)
Expand Down
4 changes: 0 additions & 4 deletions Makethird
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,8 @@ endif
ifeq ($(HAVE_LEPTONICA),yes)
THIRD_CFLAGS += -DHAVE_LEPTONICA
ifeq ($(USE_SYSTEM_LEPTONICA),yes)
THIRD_CFLAGS += $(SYS_LEPTONICA_CFLAGS)
THIRD_LIBS += $(SYS_LEPTONICA_LIBS)
else
THIRD_CFLAGS += $(LEPTONICA_CFLAGS)
THIRD_LIBS += $(LEPTONICA_LIBS)
THIRD_SRC += $(LEPTONICA_SRC)
$(OUT)/thirdparty/leptonica/%.o: thirdparty/leptonica/%.c
Expand All @@ -250,10 +248,8 @@ endif
ifeq ($(HAVE_TESSERACT),yes)
THIRD_CFLAGS += -DHAVE_TESSERACT
ifeq ($(USE_SYSTEM_TESSERACT),yes)
THIRD_CFLAGS += $(SYS_TESSERACT_CFLAGS)
THIRD_LIBS += $(SYS_TESSERACT_LIBS) -lstdc++
else
THIRD_CFLAGS += $(TESSERACT_CFLAGS)
THIRD_LIBS += $(TESSERACT_LIBS)
THIRD_SRC += $(TESSERACT_SRC)
$(OUT)/thirdparty/tesseract/%.o: thirdparty/tesseract/%.cpp
Expand Down

0 comments on commit b2d0556

Please sign in to comment.