summaryrefslogtreecommitdiff
blob: 297c7d78257d4725c35cf36dc27ac4e6189c8348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
CXXFLAGS is used as a "common" flags variable and passed to CFLAGS,
but want to use user's CFLAGS for CC rather than CXXFLAGS. Workaround
with a temporary variable and also drop -O3/lto from defaults.
--- a/libretro/Makefile
+++ b/libretro/Makefile
@@ -4,3 +4,5 @@
 
-LTO ?= -flto
+LTO :=
+ORIG_CXXFLAGS := $(CXXFLAGS)
+CXXFLAGS :=
 SPACE :=
@@ -580,4 +582,4 @@
 else
-   CFLAGS += -O3 -DNDEBUG
-   CXXFLAGS += -O3 -DNDEBUG
+   CFLAGS += -DNDEBUG
+   CXXFLAGS += -DNDEBUG
 endif
@@ -612,3 +614,4 @@
 CXXFLAGS	+= -DRIGHTSHIFT_IS_SAR -D__LIBRETRO__ -DALLOW_CPU_OVERCLOCK
-CFLAGS		:= $(CXXFLAGS)
+CFLAGS		:= $(CXXFLAGS) $(CFLAGS)
+CXXFLAGS	+= $(ORIG_CXXFLAGS)
 CFLAGS          += -DHAVE_STDINT_H