Commit ac7dd63b authored by Chun-wei Fan's avatar Chun-wei Fan

Visual Studio projects: Support arm64/aarch64 builds better

Update the NMake Makefiles used for generating the various sources be able to
cope with an ARM64 build environment, and update the project files, in
particular for Visual Studio 2017 (VisualStudioVersion 15.0) so that we can
pull in the system .lib's that were somehow excluded from the default list
on ARM64 builds.

Also, add a custom Directory.Build.props in win32/vs15 so that we do not
try to build with the Windows 8.1 SDK by defualt, which is not ready for ARM64
builds, but instead uses the appropriate Windows 10 SDK that supports this.

Update the README.win32 file to give people instructions on how ARM64 builds
can be carried out.
parent a7b93d62
Pipeline #241205 passed with stages
in 43 minutes and 2 seconds
......@@ -175,6 +175,27 @@ instance the makefile.msc files might not produce identically named
DLLs and import libraries as the "autoconfiscated" makefiles and
libtool do. If this bothers you, you will have to fix the makefiles.
If desiring to build binaries for ARM64 (aarch64), one needs to use the
Visual Studio 2017 or 2019 solution files, or use Meson with a
cross-compilation file, with a Windows 10 SDK that supports ARM64
builds. At this point, building the introspection files is not supported
for ARM64 builds, and you will need a Python interpreter and
glib-compile-resources binaries that run on the build machine. For Visual Studio
2017 ARM64 builds, do also check the Directory.Build.props file in $(srcroot)/win32/vs15
indicates a Windows 10 SDK version that supports ARM64 builds exists on the build machine.
For building ARM64 binaries with the Visual Studio projects, prior to the build,
you may need to update gtk3-gen-srcs.props to pass in the variables GLIB_MKENUMS,
indicated by <GenerateRequiredSourcesBase> so that they point to the glib-mkenums,
glib-genmarshal, gdbus-codegen and glib-compile-resources that will run on the build
machine. You may also need to update gtk3-version-paths.props to update PythonDir to
the installation of the Python interpreter that will run on the build machine. To carry
out the actual build using the solution files, use the "Configuration Manager" to add the
ARM64 build configs by copying the settings from the x64 configs, and then build the solution.
The build instructions for such builds otherwise follow the standard Win32 (x86) and
x64 builds, but you need to ensure that you have ARM64 builds of the various dependencies.
3) Using Meson (for Visual Studio and MinGW builds)
......@@ -21,6 +21,8 @@ _HASH=^#
&& ![echo PLAT=Win32 >> vercl.x] \
&& ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
&& ![echo PLAT=x64 >> vercl.x] \
&& ![echo $(_HASH)elif defined(_M_ARM64) >> vercl.x] \
&& ![echo PLAT=arm64 >> vercl.x] \
&& ![echo $(_HASH)endif >> vercl.x] \
&& ![cl -nologo -TC -P vercl.x $(ERRNUL)]
!include vercl.i
......@@ -10,7 +10,8 @@
<CommonARM64SystemLibs Condition="'$(VisualStudioVersion)|$(Platform)' == '15.0|arm64'">ole32.lib;advapi32.lib;shell32.lib;gdi32.lib</CommonARM64SystemLibs>
......@@ -43,6 +44,9 @@ nmake -f gtk-introspection-msvc.mak CFG=$(Configuration) PREFIX=$(GlibEtcInstall
<BuildMacro Include="CommonARM64SystemLibs">
<BuildMacro Include="GtkBinaryVersion">
<PropertyGroup Label="Globals">
<WindowsTargetPlatformVersion Condition="'$(Platform)' == 'arm64'">10.0.19041.0</WindowsTargetPlatformVersion>
include $(top_srcdir)/Makefile.decl
README.txt \
gtk+.sln \
gtk3-prebuild.vcxproj \
......@@ -40,7 +40,9 @@ EXTRA_DIST += \
gtk3-install.props \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment