Commit Graph

264 Commits

Author SHA1 Message Date
Chun-wei Fan
8200b08d82 build/win32/generate-msvc.mak: Generate GResource sources for demos
...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).
2019-07-31 18:54:28 +08:00
Chun-wei Fan
6775e63d99 build/win32/config-msvc.mak.in: Add more configurations
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.
2019-07-31 18:54:16 +08:00
Chun-wei Fan
80c14d7cf9 build/win32/config-msvc.mak.in: Define a default PREFIX
If PREFIX was not passed when invoking generate-msvc.mak, define a
default PREFIX that is consistent with the MSVC project files, for
convenience.
2019-07-31 16:02:53 +08:00
Chun-wei Fan
78dcdbc246 build/win32: Track resouce listings in gdk/gtk
This is so that we can re-generate the GResource sources if any of the
items are updated.
2019-07-30 12:08:08 +08:00
Chun-wei Fan
f068dcc3be MSVC projects: Drop gtk3-prebuild.vcxproj.filters
We don't need that file anymore.  Also remove some leftover unused items
in gtk3-gen-srcs.props.
2019-07-30 11:00:49 +08:00
Chun-wei Fan
c397fe420b generate-msvc.mak: Allow custom tools for glib-compile-resources
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.
2019-07-30 08:40:59 +08:00
Chun-wei Fan
5b3ea0f24c generate-msvc.mak: Generate gtk/gtkmarshalers.[c|h]
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.
2019-07-29 18:01:40 +08:00
Chun-wei Fan
a86b3c453a generate-msvc.mak: Generate gtk/gtkresources.[c|h]
This makes the MSVC project files generate gtk/gtkresources.[c|h], along
with gtk/gtk.gresource.xml.
2019-07-29 17:48:50 +08:00
Chun-wei Fan
b9d9c59afa MSVC projects: Use NMake to generate the sources in gtk/
...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.
2019-07-29 16:30:31 +08:00
Chun-wei Fan
2b9493429b MSVC projects: Fix demos build
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.
2019-07-29 12:34:49 +08:00
Chun-wei Fan
ba54e7b823 build/Makefile-newvs.am: Fix rebuilds
The various MSVC project files may not be re-copied from the 2010 ones
when things are being updated.  Fix that by monitoring changes from
build/win32/vs10/Makefile.
2019-07-29 12:07:15 +08:00
Chun-wei Fan
44e8dcdf28 build/win32: Dist forgotten file
We need to dist gen-gdkversionmacros-h.py...
2019-07-25 23:40:05 +08:00
Chun-wei Fan
58ee7adc29 MSVC builds: Generate most of the built sources in gdk/
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.
2019-07-25 18:04:58 +08:00
Chun-wei Fan
7fb9cddf1a MSVC Projects: Re-work gtk3-prebuild project
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.
2019-07-25 16:16:16 +08:00
Simon McVittie
6624f5f5a9 Makefile.msvc_introspection: Delete lists before appending
Otherwise, we'll repeatedly append the same files to the list.

Detected by running `make distcheck` twice in the same tree, with build
system changes in between.

Signed-off-by: Simon McVittie <smcv@debian.org>
2019-07-18 11:21:10 +01:00
Chun-wei Fan
201327a49a MSVC projects: Define a default PythonDir for VS2019 builds
We still use Python 3.6.x for VS2019 builds as VS2015/2017 builds are
binary compatible with 2019 builds.
2019-07-16 16:58:30 +08:00
Chun-wei Fan
2d3c0e9e7d build/win32/detectenv-msvc.mak: Update error message
We now support up to Visual Studio 2019, not just 2015, so don't
confuse people here...
2019-06-18 16:30:58 +08:00
Chun-wei Fan
6918fd70c8 Visual Studio 2019 builds: Enable /HIGHENTROPYVA for x64 builds
This improves the security of the built binaries.
2019-06-18 16:20:28 +08:00
Chun-wei Fan
a8f10f6865 Visual Studio: "Add" Visual Studio 2019 project files
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.
2019-06-18 16:07:23 +08:00
Chun-wei Fan
0b50915878 Visual Studio projects: Fix generating gtktypefuncs.inc
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.
2019-06-18 14:37:58 +08:00
Chun-wei Fan
1a4d396d6f Visual Studio projects: Add include path for FriBidi
The Fribidi headers tend to be under $(PREFIX)\include\fribidi\, so we
want to try to look for these headers in there as well.
2019-02-21 16:44:06 +08:00
Chun-wei Fan
638b136e34 Visual Studio projects: Link to FriBidi
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.
2019-02-21 10:19:21 +08:00
Chun-wei Fan
c89328766a Visual Studio builds: Use UNIX line endings for projects
Make things consistent across the board.  Only the .sln files and the
various README files under build/win32 should have Windows CR/LF line
endings.
2019-01-18 16:43:47 +08:00
Chun-wei Fan
466c87dec5 build/win32/vs10/gtk3-install.props: Remove from tree
This file is generated during 'make dist', so we should not need to
track it in GIT.
2019-01-18 16:41:26 +08:00
Chun-wei Fan
78fef66866 Visual Studio builds: Improve Introspection build process
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.
2019-01-18 16:35:28 +08:00
Chun-wei Fan
5ffbeeff91 MSVC builds: Improve introspection build process
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.
2019-01-18 16:25:49 +08:00
Christoph Reiter
8797deb4b2 Visual Studio builds: update for gdk now using pangowin32. See !436 2018-12-08 14:17:34 +01:00
Chun-wei Fan
5d903cb094 builds: Fix introspection with MSVC builds
For building the introspection dumper program on Visual Studio, leave out
the G_LOG_DOMAIN as g-ir-scanner does not like it when it constructs the
compiler command line for Visual Studio.

Also ensure that we are looking for the freshly-built libraries by looking
for the .lib's from the output directories of the Visual Studio project files.
2018-09-11 18:13:10 +08:00
Chun-wei Fan
af66faf604 Add a EGL renderer (via ANGLE) for Windows
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.
2018-06-28 15:33:42 +08:00
Chun-wei Fan
0dde06124e Visual Studio 2008 builds: Generate gtk/gtktypefuncs.c
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.
2018-05-12 11:03:55 +08:00
Chun-wei Fan
1d02739992 Visual Studio 201x builds: Clean up project files
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.
2018-05-12 10:52:47 +08:00
Chun-wei Fan
a8262c7581 Visual Studio 201x builds: Fix previous commit
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.
2018-05-12 10:24:59 +08:00
Chun-wei Fan
1517acee55 Visual Studio 201x builds: Generate gtk/gtktypefuncs.c
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.
2018-05-12 01:15:33 +08:00
Chun-wei Fan
84ff404a17 Visual Studio builds: Fix .pc generation
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.
2018-03-19 16:53:57 +08:00
Chun-wei Fan
9c1a0b80ae Visual Studio builds: Improve binary security
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.
2017-10-20 17:01:30 +08:00
Chun-wei Fan
935e48ce09 build: Install Emoji chooser GSettings files in MSVC projects
This is needed for the Emoji chooser to work on Visual Studio builds.
2017-08-29 13:05:52 +08:00
Chun-wei Fan
3d4b721e28 build: Fix last commit
Another pango-1.0.lib was added accidently to the list of .lib files for
the GTK+ to link to.  Remove that, although it shouldn't really matter.
2017-08-28 16:28:18 +08:00
Chun-wei Fan
09b7dc81a6 build: Integrate introspection builds into MSVC projects
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.
2017-08-28 16:18:24 +08:00
Chun-wei Fan
e579245b1d build: Prepare NMake Makefiles for MSVC project integration
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).
2017-08-28 16:15:11 +08:00
Chun-wei Fan
24fd61512b build: Set PythonDir according to MSVC version in projects
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.
2017-08-28 15:56:18 +08:00
Chun-wei Fan
74ffc85b80 build: Use PythonDir in Visual Studio projects
This is to avoid any confusion with the PYTHONPATH envvar that is used
by Python for additional locations for looking for modules.
2017-08-28 15:55:59 +08:00
Chun-wei Fan
801e9cf74b build/win32/replace.py: Fix replacing items in files with UTF-8 content
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
2017-05-09 18:37:20 -07:00
Chun-wei Fan
76d7c0bbed build/Makefile.msvcproj: Remove MSVC 2017 projects before re-generation
This ensures a fresh version from the 2010 projects are copied and
processed.
2017-03-03 17:35:28 +08:00
Chun-wei Fan
c6f0df26f6 Visual Studio builds: Support Visual Studio 2017
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.
2017-02-17 15:09:16 +08:00
Chun-wei Fan
25fd5710f7 Visual Studio builds: Fix Broadway builds
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.
2016-11-16 11:50:32 +08:00
Chun-wei Fan
a820acee00 Visual Studio builds: Fix .pc generation
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.
2016-11-14 16:27:21 +08:00
Chun-wei Fan
29b2828c9d Visual Studio projects: Fix RootNamespace
This is more of a cosmetic fix, but make things more consistent across the
board.
2016-11-02 10:37:07 +08:00
Chun-wei Fan
038766a82f MSVC builds: Simplify install process for MSVC 2010+
Use a for loop to copy the logo files.  Unfortunately the MSVC 2008
projects don't like this approach, seemingly.
2016-10-27 14:44:12 +08:00
Chun-wei Fan
271211da8c build/win32/vs10/gtk3-install.vcxproj: Fix project references
There is a typo for gtk-update-icon-cache, which may cause problems
when running the install project.  Fix this.
2016-10-27 12:30:04 +08:00
Chun-wei Fan
d93f8b00ad Remove gtk3-install.props's during re-generation
This is to ensure the changes in the generated
build/win32/vs10/gtk3-install.props are applied in
build/win32/vs[11|12|14] as well.
2016-10-19 18:50:10 +08:00