[gtk/gtk-3-24] Visual Studio projects: Set GTK_HOST appropriately



commit 22391f42b842596fcdf5b78a9968cf2fcb7c48d2
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Feb 23 17:42:51 2021 +0800

    Visual Studio projects: Set GTK_HOST appropriately
    
    This will make GTK_HOST defined more like what it is on Meson builds, so that
    we set the host string appropriately according to the build that is being
    carried out, instead of defaulting to i686-pc-vsXX for all builds.
    
    Like the previous commit on win32/config-msvc.mak.in, this now sets GTK_HOST
    to be:
    
    i686-pc-vsXX for 32-bit x86 builds
    x86_64-pc-vsXX for x64 builds
    aarch64-pc-vsXX for ARM64 builds (requires VS2017 15.9.x or later)

 win32/vs10/gtk3-build-defines.props  | 8 +++++++-
 win32/vs9/gtk-3.vcprojin             | 4 ++--
 win32/vs9/gtk3-build-defines.vsprops | 4 ++++
 3 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/win32/vs10/gtk3-build-defines.props b/win32/vs10/gtk3-build-defines.props
index 0a20f662d9..490c508daa 100644
--- a/win32/vs10/gtk3-build-defines.props
+++ b/win32/vs10/gtk3-build-defines.props
@@ -9,7 +9,10 @@
     <GtkPrefixDefine>GTK_PREFIX=\"$(GtkDummyPrefix)\"</GtkPrefixDefine>
     <GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="Gdk"</GdkDefines>
     
<GtkIncludedImmodulesDefines>INCLUDE_IM_am_et;INCLUDE_IM_cedilla;INCLUDE_IM_cyrillic_translit;INCLUDE_IM_ime;INCLUDE_IM_inuktitut;INCLUDE_IM_ipa;INCLUDE_IM_multipress;INCLUDE_IM_thai;INCLUDE_IM_ti_er;INCLUDE_IM_ti_et;INCLUDE_IM_viqr</GtkIncludedImmodulesDefines>
-    
<GtkDefines>GTK_COMPILATION;G_LOG_DOMAIN="Gtk";GTK_HOST="i686-pc-vs$(VSVer)";GTK_PRINT_BACKENDS="file";GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED;$(GtkIncludedImmodulesDefines);GTK_LIBDIR="$(GtkDummyPrefix)/lib";GTK_DATADIR="$(GtkDummyPrefix)/share";GTK_DATA_PREFIX="$(GtkDummyPrefix)";GTK_SYSCONFDIR="$(GtkDummyPrefix)/etc";MULTIPRESS_CONFDIR="$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)";MULTIPRESS_LOCALEDIR="$(GtkDummyPrefix)/share/locale";GTK_VERSION="$(GtkVersion)/etc";GTK_BINARY_VERSION="$(GtkBinaryVersion)/etc";GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED</GtkDefines>
+    <GtkHostMachine Condition="'$(Platform)' == 'Win32'">i686</GtkHostMachine>
+    <GtkHostMachine Condition="'$(Platform)' == 'x64'">x86_64</GtkHostMachine>
+    <GtkHostMachine Condition="'$(Platform)' == 'arm64'">aarch64</GtkHostMachine>
+    
<GtkDefines>GTK_COMPILATION;G_LOG_DOMAIN="Gtk";GTK_HOST="$(GtkHostMachine)-pc-vs$(VSVer)";GTK_PRINT_BACKENDS="file";GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED;$(GtkIncludedImmodulesDefines);GTK_LIBDIR="$(GtkDummyPrefix)/lib";GTK_DATADIR="$(GtkDummyPrefix)/share";GTK_DATA_PREFIX="$(GtkDummyPrefix)";GTK_SYSCONFDIR="$(GtkDummyPrefix)/etc";MULTIPRESS_CONFDIR="$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)";MULTIPRESS_LOCALEDIR="$(GtkDummyPrefix)/share/locale";GTK_VERSION="$(GtkVersion)/etc";GTK_BINARY_VERSION="$(GtkBinaryVersion)/etc";GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED</GtkDefines>
     <CommonARM64SystemLibs Condition="'$(VisualStudioVersion)|$(Platform)' == 
'15.0|arm64'">ole32.lib;advapi32.lib;shell32.lib;gdi32.lib</CommonARM64SystemLibs>
     <GtkGdkCommonLibs>pangowin32-1.0.lib;fribidi.lib;imm32.lib;$(CommonARM64SystemLibs)</GtkGdkCommonLibs>
     <GdkAdditionalLibs>winmm.lib;dwmapi.lib;setupapi.lib;$(GtkGdkCommonLibs)</GdkAdditionalLibs>
@@ -62,6 +65,9 @@ nmake -f gtk-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstall
     <BuildMacro Include="GtkIncludedImmodulesDefines">
       <Value>$(GtkIncludedImmodulesDefines)</Value>
     </BuildMacro>
+    <BuildMacro Include="GtkHostMachine">
+      <Value>$(GtkHostMachine)</Value>
+    </BuildMacro>
     <BuildMacro Include="GtkDefines">
       <Value>$(GtkDefines)</Value>
     </BuildMacro>
diff --git a/win32/vs9/gtk-3.vcprojin b/win32/vs9/gtk-3.vcprojin
index c17fd45051..547e4216fa 100644
--- a/win32/vs9/gtk-3.vcprojin
+++ b/win32/vs9/gtk-3.vcprojin
@@ -96,7 +96,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="0"
                                AdditionalIncludeDirectories="..\..\gtk;..\..\gdk;..\..\gdk\win32"
-                               PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefines)"
+                               PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefinesX64)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -128,7 +128,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\gtk;..\..\gdk;..\..\gdk\win32"
-                               PreprocessorDefinitions="$(GtkDefines)"
+                               PreprocessorDefinitions="$(GtkDefinesX64)"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
diff --git a/win32/vs9/gtk3-build-defines.vsprops b/win32/vs9/gtk3-build-defines.vsprops
index 8efb6b1574..be5223c84e 100644
--- a/win32/vs9/gtk3-build-defines.vsprops
+++ b/win32/vs9/gtk3-build-defines.vsprops
@@ -43,6 +43,10 @@
                Name="GtkDefines"
                
Value="GTK_COMPILATION;G_LOG_DOMAIN=\&quot;Gtk\&quot;;GTK_HOST=\&quot;i686-pc-vs$(VSVer)\&quot;;GTK_PRINT_BACKENDS=\&quot;file\&quot;;GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED;$(GtkIncludedImmodulesDefines);GTK_LIBDIR=\&quot;$(GtkDummyPrefix)/lib\&quot;;GTK_DATADIR=\&quot;$(GtkDummyPrefix)/share\&quot;GTK_DATA_PREFIX=\&quot;$(GtkDummyPrefix)\&quot;;GTK_SYSCONFDIR=\&quot;$(GtkDummyPrefix)/etc\&quot;;MULTIPRESS_CONFDIR=\&quot;$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\&quot;;MULTIPRESS_LOCALEDIR=\&quot;$(GtkDummyPrefix)/share/locale\&quot;;GTK_VERSION=\&quot;$(GtkVersion)/etc\&quot;;GTK_BINARY_VERSION=\&quot;$(GtkBinaryVersion)/etc\&quot;;GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED"
        />
+       <UserMacro
+               Name="GtkDefinesX64"
+               
Value="GTK_COMPILATION;G_LOG_DOMAIN=\&quot;Gtk\&quot;;GTK_HOST=\&quot;x86_64-pc-vs$(VSVer)\&quot;;GTK_PRINT_BACKENDS=\&quot;file\&quot;;GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED;$(GtkIncludedImmodulesDefines);GTK_LIBDIR=\&quot;$(GtkDummyPrefix)/lib\&quot;;GTK_DATADIR=\&quot;$(GtkDummyPrefix)/share\&quot;GTK_DATA_PREFIX=\&quot;$(GtkDummyPrefix)\&quot;;GTK_SYSCONFDIR=\&quot;$(GtkDummyPrefix)/etc\&quot;;MULTIPRESS_CONFDIR=\&quot;$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\&quot;;MULTIPRESS_LOCALEDIR=\&quot;$(GtkDummyPrefix)/share/locale\&quot;;GTK_VERSION=\&quot;$(GtkVersion)/etc\&quot;;GTK_BINARY_VERSION=\&quot;$(GtkBinaryVersion)/etc\&quot;;GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED"
+       />
        <UserMacro
                Name="GtkGdkCommonLibs"
                Value="pangowin32-1.0.lib fribidi.lib imm32.lib"


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