[vlc-devel] [PATCH v2 2/2] contrib: Keep debug and optimization flags separate

Marvin Scholz epirat07 at gmail.com
Thu Jun 13 19:34:09 CEST 2019


Passing the debug symbol flag to meson can cause issues when meson
uses these for tests: https://github.com/mesonbuild/meson/issues/5482

The meson buildtype is already set to debug or release, so passing
the arguments is redundant.
---
 contrib/src/main.mak | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index 5177019ba2..54393a1fae 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -183,21 +183,21 @@ cppcheck = $(shell $(CC) $(CFLAGS) -E -dM - < /dev/null | grep -E $(1))
 
 EXTRA_CFLAGS += -I$(PREFIX)/include
 CPPFLAGS := $(CPPFLAGS) $(EXTRA_CFLAGS)
-CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS) -g
-CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) $(EXTRA_CXXFLAGS) -g
+CFLAGS := $(CFLAGS) $(EXTRA_CFLAGS)
+CXXFLAGS := $(CXXFLAGS) $(EXTRA_CFLAGS) $(EXTRA_CXXFLAGS)
 LDFLAGS := $(LDFLAGS) -L$(PREFIX)/lib $(EXTRA_LDFLAGS)
 
+DBGOPTIMFLAGS := -g
+
 ifdef ENABLE_PDB
 CFLAGS := $(CFLAGS) -gcodeview
 CXXFLAGS := $(CXXFLAGS) -gcodeview
 endif
 
 ifndef WITH_OPTIMIZATION
-CFLAGS := $(CFLAGS) -Og
-CXXFLAGS := $(CXXFLAGS) -Og
+DBGOPTIMFLAGS += -Og
 else
-CFLAGS := $(CFLAGS) -O2
-CXXFLAGS := $(CXXFLAGS) -O2
+DBGOPTIMFLAGS += -O2
 endif
 
 # Do not export those! Use HOSTVARS.
@@ -320,13 +320,13 @@ HOSTTOOLS := \
 	PATH="$(PREFIX)/bin:$(PATH)"
 HOSTVARS := \
 	CPPFLAGS="$(CPPFLAGS)" \
-	CFLAGS="$(CFLAGS)" \
-	CXXFLAGS="$(CXXFLAGS)" \
+	CFLAGS="$(CFLAGS) $(DBGOPTIMFLAGS)" \
+	CXXFLAGS="$(CXXFLAGS) $(DBGOPTIMFLAGS)" \
 	LDFLAGS="$(LDFLAGS)"
 HOSTVARS_PIC := $(HOSTTOOLS) \
 	CPPFLAGS="$(CPPFLAGS) $(PIC)" \
-	CFLAGS="$(CFLAGS) $(PIC)" \
-	CXXFLAGS="$(CXXFLAGS) $(PIC)" \
+	CFLAGS="$(CFLAGS) $(DBGOPTIMFLAGS) $(PIC)" \
+	CXXFLAGS="$(CXXFLAGS) $(DBGOPTIMFLAGS) $(PIC)" \
 	LDFLAGS="$(LDFLAGS)"
 
 # For cross-compilation with meson, do not set compiler and flags
-- 
2.20.1 (Apple Git-117)



More information about the vlc-devel mailing list