File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,11 @@ endif
159159
160160ifeq ($(COMP ) ,mingw)
161161 comp=mingw
162- CXX=g++
162+ ifeq ($(UNAME),Linux)
163+ CXX =x86_64-w64-mingw32-g++-posix
164+ else
165+ CXX=g++
166+ endif
163167 CXXFLAGS += -Wextra -Wshadow
164168 LDFLAGS += -static
165169endif
@@ -307,7 +311,7 @@ ifeq ($(pext),yes)
307311 endif
308312endif
309313
310- # ## 3.11 Link Time Optimization, it works since gcc 4.5 but not on mingw.
314+ # ## 3.11 Link Time Optimization, it works since gcc 4.5 but not on mingw under windows .
311315# ## This is a mix of compile and link time options because the lto link phase
312316# ## needs access to the optimization flags.
313317ifeq ($(comp ) ,gcc)
@@ -319,6 +323,17 @@ ifeq ($(comp),gcc)
319323 endif
320324endif
321325
326+ ifeq ($(UNAME ) ,Linux)
327+ ifeq ($(comp ) ,mingw)
328+ ifeq ($(optimize),yes)
329+ ifeq ($(debug),no)
330+ CXXFLAGS += -flto
331+ LDFLAGS += $(CXXFLAGS )
332+ endif
333+ endif
334+ endif
335+ endif
336+
322337# ## 3.12 Android 5 can only run position independent executables. Note that this
323338# ## breaks Android 4.0 and earlier.
324339ifeq ($(arch ) ,armv7)
You can’t perform that action at this time.
0 commit comments