Makefile: ignore warnings in OpenCV headers
authorAntonio Ospite <ao2@ao2.it>
Sat, 10 Oct 2020 17:01:56 +0000 (19:01 +0200)
committerAntonio Ospite <ao2@ao2.it>
Sat, 10 Oct 2020 17:01:56 +0000 (19:01 +0200)
OpenCV header files were triggering a lot of warnings because of the
strict compiler flags set for the project.

Instead of disabling the warnings treat the OpenCV headers as system
dependencies, this way the compiler will ignore warnings on them but
will still apply the warnings to the project code.

Makefile

index 75dde40..bd0d850 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ ifeq ($(COMPILER), clang)
   LDFLAGS += -Qunused-arguments
 endif
 
-CXXFLAGS += $(shell pkg-config --cflags opencv4)
+CXXFLAGS += $(shell pkg-config --cflags opencv4 | sed -e 's/-I/-isystem/g')
 LDLIBS += $(shell pkg-config --libs opencv4)
 
 LINK.o = $(LINK.cpp)