Commit Graph

45 Commits

Author SHA1 Message Date
Chun-wei Fan
f324c650a7 gdk/: Rename gdk-pub-headers.h to gdk-sources.inc
We want to make the sources listings for libgdk shared as well.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
6e193eb141 win32/vs10/*.vcxproj: Consolidate project configs
Like what was done in the *.vcxprojin templates, consolidate project configs
that are repetitive, and use the 'Condition=' directive to distinguish between
configuration and/or target platform differences.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
3bd1ed8c31 win32/vs10/*.vcxprojin: Consolidate project configs
We can use MSBuild "Condition" items to consolidate the configs, so that we can
clean up the project files a bit.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
4c2cd5910f Visual Studio projects: Make property sheets shared
...for Visual Studio 2010 and later, since we used to copy them and
merely update the value of $(VSVer) during 'make dist' as needed.

Instead of doing that, move the property sheets for Visual Studio 2010,
which is the base version that we use, into a directory of its own, and
make the Visual Studio 2010~2022 projects look for them in that
directory, and set VSVer according to the toolset version identified by
each of the project files.

The ARM64-specific property sheet needed for VS2017 and the VS2008
property sheets will remain as they are.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
ac25eeb34a Visual Studio projects: Drop another property sheet
We can again use MSBuild trickery to do what was done in the dropped
property sheet.

Unfortunately, like the last commit, I couldn't figure out a way do to
something similar in the VS2008 project files... :|
2022-05-19 09:41:48 +08:00
Chun-wei Fan
c50cd6f95c Visual Studio projects: Drop unneeded property sheet
We can use MSBuild trickery to do what the property sheet intends to
cover
2022-05-19 09:41:48 +08:00
Chun-wei Fan
f4811ea1f1 build: Drop gtk3-install.[vsprops|props]
They are not used anymore, and are removed at this point.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
455686a57f Visual Studio Projects: Use NMake Makefile to copy build results
... and so stop using gtk3-install.[vsprops|props], and remove that
property sheet from the dist and dist the NMake Makefile for the
purpose.

Also remove win32/vs10/gtk3-install.vcxproj.filters as well, as it is
no longer needed.

We will remove the gtk3-install.[vsprops|[props][.in] in a subsequent
commit.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
3b5b8bbebe win32/: Add install-msvc.mak
This is an NMake Makefile that will replace the property sheets in the
Visual Studio project files so that we can call it from the project
files to "install" the binaries and introspection files that were built,
along with the header files and other data files, which aims to be
easier to maintain for the current approach.

This will also be expanded upon to optionally build the translation
files and make the installed files more in-line with what are done in
the Meson build files, where there could be compatibility problems with
older Visual Studio toolchains.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
331090c148 win32/create-lists-msvc.mak: Pull in the newly-split source listings
We are going to use them to help us to use an NMake Makefile to copy the
built files and headers in our "install" directory.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
8477c0e765 win32/create-lists-msvc.mak: Clean up a bit
We now have the theme CSS source listings in gtk/gtk-sources.inc, so
make use of it.  No need to repeat items from there.
2022-05-19 09:41:48 +08:00
Chun-wei Fan
e21a578cb1 gtk: Rename gtk-mkenums-headers.mak to gtk-sources.inc
We want to reuse more sources listings in other non-autotools build
systems.
2022-05-19 09:41:48 +08:00
Melroy van den Berg
d3ffdd59f8
Add missing Windows libs for printing - win32. During cross-compiling 2022-02-26 17:24:30 +01:00
Luca Bacci
0e09bb75b5 Merge branch 'improve-font-features-msvc' into 'gtk-3-24'
Visual Studio projects: Simplify building font features demo

See merge request GNOME/gtk!4336
2022-01-06 05:11:53 +00:00
Chun-wei Fan
eebc70bf27 Visual Studio projects: Simplify building font features demo
Improve the NMake Makefiles that is used to re-generate demos.h(.win32)
by re-generating the gtk3-demo Visual Studio projects, so that one would
no longer need to do that manually.

Update the build instructions accordingly.
2022-01-05 17:16:00 +08:00
Chun-wei Fan
cef3293184 Visual Studio projects: Generate versioned sources
Instead of relying on the ones that are currently shipped with the tarballs,
generate them from their .in counterparts prior to the build.  This includes
the Resource Scripts (.rc) for libgdk/libgtk, as well as gtkversion.h, in
addition to gdkversionmacros.h which can now be generated during prebuild.
2022-01-04 14:17:38 +08:00
Chun-wei Fan
089cccc929 Visual Studio: Make gen-gdkversionmacros-h.py generic
Rename the script as gen-version-items.py, and so make things more generic and
usable by other items in the build.  We want to eventually to be able to
generate the .rc files and the *version*.h files from their *.in counterparts
using this script.
2022-01-04 11:14:49 +08:00
Chun-wei Fan
fc8b70cbdf config-msvc.mak.in: Record the interface age
We want to make use of this so that we can generate the various versioned
sources easily, such as the Windows .rc scripts and the [gdk|gtk]version*.h.
2022-01-04 11:14:49 +08:00
Chun-wei Fan
6789ff7443 Visual Studio projects: Improve generating libgtk sources
This improves the source generating process by:

*  Generating the sources in the libgtk build directory, so that we do not
   pollute the source tree.
*  Support generating gtk[private]typebuiltins.[c|h] in the Visual Studio
   projects by using NMake internally.
*  Update the projects and the introspection build files so that the generated
   sources and headers can be found.
2022-01-04 11:14:41 +08:00
Chun-wei Fan
67f27409e0 GDK/build: Rename deprecated_h_sources to gdk_deprecated_h_sources
This will enable us to not confuse with the deprecated headers in
gtk/deprecated as those headers are also listed under deprecated_h_sources in
gtk/deprecated/Makefile.inc, when we include the makefile snippets in both
gdk/ and gtk/.
2022-01-04 11:07:28 +08:00
Chun-wei Fan
334333f779 Visual Studio projects: Improve generating GDK sources
This makes the rest of the sources that are generated being put in GDK's build
directory for the Visual Studio projects, instead of being placed in GDK's
source subdir, so that:

*  We can avoid polluting GDK's source tree.
*  The Visual Studio builds won't interfere with the Meson builds.

Update the project files to look for the generated sources and headers in the
right places, as well as making the introspection builds look for the generated
sources as well.

Also remove the gtk3-gen-srcs property sheets and put the relevant parts in the
corresponding gtk3-build-defines property sheets, to clean things up a bit.
2022-01-04 11:07:28 +08:00
Chun-wei Fan
74d43defc5 win32: Support (re-)generating gdkenumtypes.[c|h]
Add support in the NMake Makefiles used by the Visual Studio builds to generate
the enumeration sources in gdk/ in its own build directory.
2022-01-04 11:07:27 +08:00
Chun-wei Fan
61dd680b02 win32: Re-organize NMake Makefiles a bit
This way, we can have the introspection NMake Makefiles share more items
with the source generating bits.

Update the Visual Studio projects accordingly
2022-01-04 11:07:27 +08:00
Chun-wei Fan
04496cc535 win32/detectenv-msvc.mak: Add section on VS2022
This will make introspection builds via the Visual Studio 2022 projects work as
the NMake Makefiles were looking for VS2019 builds, which most probably did not
exist
2021-12-22 10:12:22 +08:00
Chun-wei Fan
28337d68a3 Visual Studio projects: Update README for additional features
Rename README_EGL_MSVC.txt to README_FEATURES_MSVC.txt, as we now have
more features that can be included in the builds using the Visual
Studio projects, which require additional depedencies and manual
enabling.

Specifically, this outlines how the font tweaking feature in libgtk can
be enabled and for people who wish to do so, how to enable the Font
Features demo in gtk3-demo.exe.
2021-11-29 12:25:53 +08:00
Chun-wei Fan
079ee4e31e win32/generate-msvc.mak: Add rule to regenerate demos.h.win32
We can regenerate demos.h.win32 with or without the font features demo
by using the regenerate-demos-h-win32 target with or without secifying
the FONT_FEATURES_DEMO=1 flag on the NMake command line.
2021-11-29 12:25:53 +08:00
Chun-wei Fan
c3c759cbdd Visual Studio projects: Define __MSVC_PROJECTS__
...in the libgtk3 project, so that we can automatically link to
harfbuzz.lib if we have a sufficiently-new version of Pango and HarfBuzz
installed, so that the code to enable font features can be linked
properly, even if we don't explicitly put harfbuzz.lib in the list of
libraries that we feed into the linker in the project files.

If one is using pre-Pango-1.44.x and/or pre-HarfBuzz-2.2.0 and intends
to enable font features support, one still must update config.h.win32 to
make sure HAVE_PANGOFT2 and HAVE_HARFBUZZ is defined, and put
pangoft2-1.0.lib, harfbuzz.lib and freetype.lib (or so) in the
"Additional Libraries" under the linker settings in the projects
manually, as required before.
2021-11-29 12:25:52 +08:00
Chun-wei Fan
1234b46d3b Visual Studio projects: "Add" Visual Studio 2022 projects
Like the Visual Studio 2012+ projects, copy the Visual Studio 2010
projects and replace the items in there as needed, so that we can
obtain Visual Studio 2022 project files, since they are all in the
MSBuild format.
2021-10-14 10:53:18 +08:00
Luca Bacci
712721b60a
Add support for Windows Pointer Input Stack
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1563
2021-07-03 16:04:28 +02:00
Marco Trevisan (Treviño)
a1aecd26d5 gtk: Include emoji data when using autotools and msvc build systems
Differently from the meson case, here we just include the emoji data
files into the global gresources file, get_emoji_data() supports this
and it's just easier to handle in these build systems.
2021-05-06 16:03:11 +02:00
Chun-wei Fan
22391f42b8 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)
2021-02-23 17:48:53 +08:00
Chun-wei Fan
c3b9f56121 win32/gtk-introspection-msvc.mak: Prepare for ARM64 builds
Currently, introspection is not well-supported for ARM64 Windows builds as:

* There is no official Python release for ARM64 Windows, but it is currently
  possible to build it with sufficient support for G-I, however...

* The tooling in Python still needs to be updated to enable ARM64 Windows
  builds for use with g-ir-scanner and friends, and...

* Introspection builds must be done on an ARM64 system, since we are running a
  dumper binary to generate the .gir files

This will attempt to prepare things for building GTK's introspection files on
Windows ARM64, but will require a custom installation of Python as noted above,
for the time being
2021-02-23 17:48:53 +08:00
Chun-wei Fan
07e06fb4dd win32/config-msvc.mak: Don't hardcode GTK_HOST to i686-pc-vsXX
Instead, rely on the mechanism that we already have to set the platform string
appropriately, eg:

i686-pc-vsXX for 32-bit x86 builds
x86_64-pc-vsXX for x64 builds
aarch64-pc-vsXX for arm64 builds
2021-02-23 17:48:53 +08:00
Chun-wei Fan
935691f94c win32/detectenv-msvc.mak: Add linker flag for ARM64
This prepares things better for ARM64 (aarch64) Windows builds, to make things
more complete and comparable to x64 and x86 builds.
2021-02-23 17:48:53 +08:00
Chun-wei Fan
508036f745 Visual Studio 201x projects: Fix generating gtk+-win32-3.0.pc
The copy command to copy gtk+-win32-3.0.pc from gtk+-3.0.pc was mistakenly
done to copy gtk+-3.0.pc two times.  Oops... :|
2021-02-23 16:39:32 +08:00
Chun-wei Fan
f8b7bd6dd6 Fix 'make dist' again
The autotools pattern rules can be off-putting...
2020-12-28 22:11:08 +08:00
Chun-wei Fan
7647208fba Try again to fix 'make dist'
It turns out that we must put Directory.Build.props in win32/vs10 and let
automake copy it over to win32/vs15/... so do that, and only dist the copy
in win32/vs15.
2020-12-24 18:10:16 +08:00
Chun-wei Fan
8f325b475b win32/Makefile-newvs.am: Fix 'make dist'
We need to account for the lack of Directory.Build.props in win32/vs10...
2020-12-24 17:05:10 +08:00
Chun-wei Fan
ac7dd63b02 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.
2020-12-24 16:27:58 +08:00
Chun-wei Fan
a7b93d62d5 Visual Studio Projects: Improve search for Harfbuzz headers
Look in the include/harfbuzz directory that is under the pre-defined prefix
directory, as Pango 1.44.x and later pulled in HarfBuzz headers for all builds
2020-12-24 13:57:28 +08:00
Chun-wei Fan
985e17772b Visual Studio projects: Do not hardcode gdbus-codegen path
Instead, use the $(GDBUS_CODEGEN) NMake Makefile variable, so that it may be
overridden if needed
2020-12-24 13:48:36 +08:00
Chun-wei Fan
de6498f18c Visual Studio: Use G_ENABLE_DEBUG for all builds
This way, we can enable the built binaries to print out diagnostic
messages as needed by the values we set via the envvar GDK_DEBUG.

The release configs of the Visual Studio project files follow the
settings of Meson's `debugoptimized` build settings.
2020-12-23 10:46:58 +08:00
Chun-wei Fan
ffe2df7b6a MSVC builds: Make file generating less disrupting
Update the NMake Makefiles to invoke glib-compile-resources with
'start /min' so that when gdk-pixbuf-pixdata, json-glib-format
and xmllint are invoked by glib-compile-resources, cmd.exe windows
will not popup whenever these auxiliary tools are invoked, when one
builds GTK with the Visual Studio projects.

This will reduce the distraction that is caused during the time the
source files are generated, as a popup cmd.exe window will disrupt the
window focus as they appear, and will make the process a bit quicker.
2020-07-25 11:57:04 +08:00
Chun-wei Fan
d1dcf88d75 MSVC Projects: Correct generated files paths
This should be more of a cosmetic change, more for the project files,
but let's keep things in good order.
2020-07-25 11:12:21 +08:00
Chun-wei Fan
1feb169bfa Visual Studio projects: move projects to win32/
This will simplify our source tree a bit
2020-07-16 18:57:03 +08:00