...for the demos we build in the MSVC projects, so those that are not
built by the projects are not covered by this change. This is so that
we can reduce the files that we are actually dist'ing in a release
tarball (see MR !1001).
This adds a configurable path for pkg-config, in case it is not in the
PATH, which will replace the entry in introspection-msvc.mak eventually.
Also add a set of preprocessor flags for GDK that we can use later for
introspection.
Fix the previous commit as the default PREFIX is missing a layer of
parentdir.
As some external tools are used by glib-compile-resources, such as
xmllint, gdk-pixbuf-pixdata and (perhaps in the future)
json-glib-format, allow people to pass in the full paths for them when
invoking the NMake Makefiles to generate the various sources if they are
not in the PATH or in where glib-compile-resources.exe is.
Generate the marshaller sources in gtk/. This will indicate that all
the sources that need to be generated in gtk/ are now generated for the
MSVC projects, except for the ones that are generated by glib-mkenums.
...instead of in the gtk-3 project. This will also make the project
files a bit cleaner. Note that this commit only moves all the source
code generating steps in the gtk-3 into the NMake Makefile, and so
generate those sources in the gtk3-prebuild project.
I forgot to include the copying of demos.h.win32 to demos.h step, so the
demos could not be properly built from the projects. Fix that.
Also fix the command line where we generate gtkdbusgenerated.[c|h] which
was accidentally changed.
With the exception of the enumeration sources (gdkenumtypes.h and
gdkenumtypes.c), the generared sources in gdk/ (gdkversionmacros.h,
gdkresources.[c|h], gdkmarshalers.[c|h] are now generated in the
gtk3-prebuild projects with the NMake Makefiles.
Make build/win32/config-msvc.mak filled with the version info from
autotools, too.
Make it into a NMake Makefile project type, which will form the basis
for having less of the generated sources being dist'ed, which is the
goal of merge request !1001.
Another nice side effect of this is that it makes the gtk3-prebuild
projects cleaner.
Use the scripts that we have to copy the 2010 projects and updating
the various items in the project files to make them Visual Studio
2019-compatible upon 'make dist'.
Also ensure that the introspection NMake Makefiles can properly detect
that we are building with Visual Studio 2019.
From the Meson port, gtk/gtktesteutils.c now includes
gtk/gtktypefuncs.in instead of gtk/gtktypefuncs.c, so we should do the
same thing in the Visual Studio projects, to fix the build.
Also, since build/win32/gentypefuncs.py is an adaptation of the script
from GTK master (in gtk/), and that we now have gtk/gentypefuncs.py, we
should use the version of the script in gtk/ and drop the one in
build/win32.
We now need to link to fribidi.lib explicitly in both GDK and GTK.
Since the Pango we require in 3.24.x already requires a FriBidi
installation, the .lib and DLL should already be available for the
build.
Adapt the Visual Studio project files to output the introspection files
in the same directories where the built binaries are located from the
previous patch.
Also, make the gtk3-introspect project dependent on the gdk-3 and gtk-3
projects only, so that we can build the introspection files without
needing to finish the whole build process. In order to "install" the
built introspection files, the gtk3-install project is now where this is
being done. Note that the introspection builds is still not built by
default at this point.
To avoid confusion, have the NMake Makefiles output the built introspection
files in the same location where the binaries are built for the project
files, according to the Visual Studio version, platform and configuration
where the build is carried out.
Also make generating the introspection NMake snippet portion more robust to
source additions and removals by checking on Makefile changes too.
This is for adding a EGL-based renderer which is done via the ANGLE
project, which translate EGL calls to Direct3D 9/11. This is done as a
possible solution to issue #105, especially for cases where the needed
full GL extensions to map OpenGL to Direc3D is unavailable or
unreliable, or when the OpenGL implementation from the graphics drivers
are problematic.
To enable this, do the following:
-Build ANGLE and ensure the ANGLE libEGL.dll and libGLESv2.dll are
available. A sufficiently-recent ANGLE is needed for things to
work correctly--note that the copy of ANGLE that is included in
qtbase-5.10.1 is sufficient. ANGLE is licensed under a BSD 3-clause
license. Note also that Visual Studio 2013 or later is required to
build ANGLE from QT-5.10.1, but the 2013-built ANGLE DLLs can work
without without problems for GTK+ that is built with Visual Studio
2008 or later.
-Build libepoxy on Windows with EGL support enabled.
-Define GDK_WIN32_ENABLE_EGL when building gdk-win32.lib when building
with Visual Studio, or pass in --enable-win32-gles during configure
when building with MinGW/mingw-w64.
-Prior to running GTK+ programs, the GDK_GL envvar needs to contain
gles.
Known issues:
-Only OpenGL ES 3 is supported, ANGLE's ES 2 does not support the needed
extensions, notably GL_OES_vertex_array_object, but its ES 3 support is
sufficient.
-There is no autodetection or fallback mechanism to enable using
EGL/Angle automatically yet. There is no plans to do this in this
commit.
Thanks to LRN for pointing out that we should #include
"win32/gdkwin32.h" instead of #include "gdkwin32.h" for gdkgl.c. LRN
also did the autotools portion of this patch.
Further notes about the autotools --enable-win32-gles option, fom LRN:
This adds --enable-win32-gles option, which enables the
code for GLES renderer. This commit also adds tests for WGL and
EGL in epoxy. The absence of WGL is highly unlikely (it's enabled
by default), but checking for EGL when GLES is enabled is necessary,
as EGL is disabled in Windows builds of epoxy by default.
This is the updates to the Visual Studio 2008 projects to generate
gtk/gtktypefuncs.c using the preprocessor and the gentypefuncs.py that
was adapted from master.
Unfortunately we could not clean up the projects as we did for the 201x
ones due to the differences in project file format.
Combine repetitive parts, and unify using $(PythonDir) for all builds,
which the paths set in the property sheets are now based on the Visual
Studio version and platform combination.
Not that it will make a difference, but to be consistent with the
autotools builds. Include gtkx.h instead of gtk.h when we generate the
source to feed to the preprocessor.
We now need to generate gtktypefuncs.c by ourselves, so modify the
gentypefuncs.py script from master, and add a custom build step in the
projects to generate gtktypefuncs.c. The custom build step for the 2008
projects will be added later.
Since the Cairo build files for Visual Studio does not really generate
the pkg-config files for us, and we stopped making makeshift ones in
gobject-introspection, stop making the .pc files we generate here refer
to the Cairo .pc's, and instead make them link directly to
cairo-gobject.lib and cairo.lib.
Ensure that the /DYNAMICBASE linker option (which is actually the
default) is enabled for all of our Visual Studio project builds, as the
gtk3-demo projects inadvertly disabled it.
Also, for x64 builds on MSVC 2012 or later, enable /HIGHENTROPYVA to
enhance the security of our binaries as well.
Pointed out by Ignacio Casal Quinteiro.
This is so that it is easier for one building GTK+ with Visual Studio to
build the introspection files as well in one shot. Note that this is
not built by default, so one needs to select the gtk3-introspect
explicitly to build (and clean up) the introspection files.
For this to work, one needs to ensure the following:
-A complete build of GObject-Introspection in $(GlibEtcInstallRoot),
that is built with the same installation of the Python interpretor that
is used here (see PythonDir and PythonDirX64 in
gtk3-version-paths.[vsprops|props]).
-Introspection files for ATK, GDK-Pixbuf and Pango, also in their proper
locations under $(GlibEtcInstallRoot), which should be built with the
same G-I installation.
The build/win32/detectenv-msvc.mak needs to be updated for Visual Studio
2017, and we ought to add quotes to surround the copy destination path
for the introspection files, so that we do not bail out in the copy
process (cmd.exe's copy command does not like '+' in them that are not
quoted).
This is to make this more in-line with what is in the G-I projects, so
that we could use this to build the introspection files for GTK+-3.22.x
directly from the project files. This is intended to follow the MSVC
versions used to build the official CPython Windows binaries, i.e.:
-3.3.x, 3.4.x: for MSVC 2010, 2012, 2013, which is built with 2010
-3.5.x, 3.6.x: for 2015 and 2017, which is built with 2015.
Some files that this script will process might have UTF-8 items in
there, which can cause problems on Python 3.x as it is more strict and
careful on unicode issues.
Fix this by:
-Doing what we did before on Python 2.x
-Opening the file with encoding='utf-8' on Python 3.x
Update the autotools scripts so that we can support Visual Studio 2017
by copying the 2010 projects and updating items as needed to obtain
the 2017 projects.
Note that since the toolset version string changed for Visual Studio
2017, so allow the use of a custom toolset version string, otherwise
just generate the toolset version string as we did before.
Also, note that Visual Studio 2017 aims to be compatible with 2015
on the CRT level, so there should not be any problems using 2017-compiled
binaries with 2015-compiled ones.
After building GDK with broadway, we need to copy the GDK DLL from
[Release|Debug]_Broadway\bin to [Release|Debug]\bin, so that the
introspection builds can be done normally with CFG=[Release|Debug]. As we
renamed the projects, we needed to update the property sheets that does
the copying, which was accidently missed. Fix that.
We want to look for the gdk-pixbuf-2.0 package, and we should leave a space
between -ldwmapi and -lzlib1 when we enable Broadway.
Also copy the generated gdk-3.0.pc and gtk+-3.0.pc as gdk-win32-3.0.pc and
gtk+-win32-3.0.pc respectively, to be in-line with the autotools builds.
Split out the part where we generate/update the caches for the GSchemas
and the icons, so that it is easier to ensure that things continue to
function correctly when we have GlibEtcInstallRoot != CopyDir.
Consolidate the .lib's that we need to link to for GDK and GTK+ into the
property sheets, and also link to setupapi.lib as that is needed by
the port to the new GdkMonitor API.
Generate .pc files for the package, so that it would be easier for
building introspection for packages that depend on GTK+. Also split
PythonPath into PythonPath and PythonPathX64 to facilitate the build of
introspection files, which need to have Python that is built with the
same ac=rchitecture where GTK+ is built.
Clean up the formatting and spacing a bit.