[cogl/cogl-latest-win] NMake: Fix building cogl-[crate|msaa] on older VS x64




commit 5457c0ec23c6f5beb223eb5f8738dd4f823f2e0f
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Oct 19 18:03:13 2021 +0800

    NMake: Fix building cogl-[crate|msaa] on older VS x64
    
    Due to a bug in the optimizer, the link hangs when building cogl-crate
    on Visual Studio 2008 x64, and causes an internal compiler error when
    linking cogl-msaa on pre-Visual Studio 2013 x64.  Fix this by using /O1
    instead of /O2 as needed on x64.

 build/win32/build-rules-msvc.mak | 13 +++++++++++++
 build/win32/config-msvc.mak      |  9 +--------
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/build/win32/build-rules-msvc.mak b/build/win32/build-rules-msvc.mak
index 2b09284c..39c30e91 100644
--- a/build/win32/build-rules-msvc.mak
+++ b/build/win32/build-rules-msvc.mak
@@ -116,6 +116,19 @@ $**
 $<
 <<
 
+!if "$(PLAT)" == "x64"
+!if $(VSVER) < 12
+!if "$(VSVER)" == "9"
+vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-examples\cogl-crate.obj: ..\..\examples\cogl-crate.c
+       @if not exist $(@D)\ md $(@D)
+       $(CC) $(CFLAGS:/O2=/O1) $(COGL_EXAMPLE_BASE_CFLAGS) $(COGL_PUB_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ 
..\..\examples\cogl-crate.c /c
+!endif
+vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-examples\cogl-msaa.obj: ..\..\examples\cogl-msaa.c
+       @if not exist $(@D)\ md $(@D)
+       $(CC) $(CFLAGS:/O2=/O1) $(COGL_EXAMPLE_BASE_CFLAGS) $(COGL_PUB_INCLUDES) /Fo$(@D)\ /Fd$(@D)\ 
..\..\examples\cogl-msaa.c /c
+!endif
+!endif
+
 vs$(PDBVER)\$(CFG)\$(PLAT)\cogl\cogl.res: ..\..\cogl\cogl.rc
 vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-pango\cogl-pango.res: ..\..\cogl-pango\cogl-pango.rc
 
diff --git a/build/win32/config-msvc.mak b/build/win32/config-msvc.mak
index cc27f766..56da7773 100644
--- a/build/win32/config-msvc.mak
+++ b/build/win32/config-msvc.mak
@@ -56,13 +56,8 @@ COGL_EXAMPLE_PROGS = \
        vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-hello.exe       \
        vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-info.exe        \
        vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-point-sprites.exe       \
-       vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-stereo.exe
-
-!if ($(VSVER) > 11) || "$(PLAT)" != "x64"
-COGL_EXAMPLE_PROGS =   \
-       $(COGL_EXAMPLE_PROGS)   \
+       vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-stereo.exe      \
        vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-msaa.exe
-!endif
 
 COGL_INTROSPECTION_TYPELIBS =
 
@@ -214,7 +209,6 @@ COGL_BUILT_LIBS =   \
        $(COGL_BUILT_LIBS)      \
        $(COGL_PANGO_LIB)
 
-!if $(VSVER) != 9 || "$(PLAT)" != "x64"
 COGL_EXAMPLE_PROGS =   \
        $(COGL_EXAMPLE_PROGS)   \
        vs$(PDBVER)\$(CFG)\$(PLAT)\cogl-crate.exe
@@ -222,7 +216,6 @@ COGL_EXAMPLE_PROGS =        \
 COGL_EXAMPLE_DEP_LIBS =        \
        $(COGL_EXAMPLE_DEP_LIBS)        \
        $(LIBCOGL_PANGO_DEP_LIBS)
-!endif
 
 !ifdef INTROSPECTION
 COGL_INTROSPECTION_TYPELIBS =  \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]