Commit Graph

229 Commits

Author SHA1 Message Date
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
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
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
Chun-wei Fan
c2ba9ca810 Visual Studio builds: Make .pc generation more flexible
Allow the use of ${exec_prefix} for libdir and includedir when passing
them in as arguments to the script.
2016-06-22 15:22:58 +08:00
Chun-wei Fan
7a0941c090 Visual Studio builds: Refine "installation" process
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.
2016-05-10 13:18:23 +08:00
Chun-wei Fan
8cda93d389 Visual Studio builds: Clean up projects a bit
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.
2016-05-09 15:35:26 +08:00
Chun-wei Fan
71bb1bebc0 Visual Studio builds: Generate .pc files
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.
2016-04-26 20:15:45 +08:00
Chun-wei Fan
9a87b6be2b MSVC builds: Update how introspection builds are done
This first adds a common autotools module that can be included by
the Makefile.am's to generate the file lists and the g-ir-scanner/
g-ir-compiler command lines to build the introspection files.

The autotools files for gdk/ and gtk/ are then updated to generate
the full file lists needed to build the introspection files, with
the full command lines for g-ir-scanner and g-ir-compiler as NMake
Makefile modules that can be used to build the introspection files
for Visual Studio builds.

https://bugzilla.gnome.org/show_bug.cgi?id=765195
2016-04-19 14:50:25 +08:00
Chun-wei Fan
ea8873da55 MSVC build: Drop crypt implementation for MSVC
We are actually not using the crypt() in GDK-Broadway for quite a while,
so the code implementation for MSVC is actually not used.  So, it's time
to get rid of this.
2016-03-02 16:52:30 +08:00
Chun-wei Fan
e15ab84e35 MSVC builds: Re-arrange include paths
Search also for the headers in include/gio-win32-2.0, as gio.h will
include those headers at some point, and arrange the include paths in a
dependency hierarchy style, top-to-down.
2016-03-02 13:02:30 +08:00
Chun-wei Fan
07d32687d8 MSVC 2008 builds: Fix previous commit
The previous commit had the MSVC 2008 property sheet in the wrong place.
Fix that.
2016-02-22 22:23:26 +08:00
Chun-wei Fan
5962daef4f Windows: Update how gtk-win32.rc is generated
On Visual Studio, unlike MinGW, manifest files are embedded via
including the manifest file as a resource file in the projects, not
via the .rc file.  This means that the line in the .rc file that
specifies the manifest file would cause trouble, so that line gets
removed when the full gtk3-win32.rc is generated on Visual Studio builds,
otherwise 2010+ Visual Studio will complain when compiling the .rc file.
Also, the inclusion of winuser.h will cause warnings during the
compilation of the .rc file.

Fix this by isolating the Win32 resource portions of gtk-win32.rc.in to
gtk-win32.rc.body.in and:
-On MinGW, construct the full gtk-win32.rc by doing the winver.h and
 winuser.h inclusion first, then append the contents of gtk-win32.rc.body,
 and then appending the line to embed the manifest file.
-On Visual Studio, simply copy the gtk-win32.rc.body to gtk-win32.rc,
 and generate the full libgtk3.manifest file.

https://bugzilla.gnome.org/show_bug.cgi?id=762311
2016-02-22 17:40:17 +08:00
Chun-wei Fan
1fec39ef0b Visual Studio builds: Use _USE_MATH_DEFINES
... to fix the build as some C99 math constant macros are being used, such
as M_SQRT2.
2016-01-06 21:12:19 +08:00
Chun-wei Fan
c049581f79 MSVC builds: Build more tools in gtk/
Build the gtk-update-icon-cache, gtk-builder-tool and gtk-query-settings
tools and run gtk-update-icon-cache as part of the post-build
"installation" process.

Pointed out (and reminded) by Paolo Borelli in bug 759436 that we should
build, "install" and run gtk-update-icon-cache in the MSVC builds as well.
2015-12-15 15:37:33 +08:00
Chun-wei Fan
dbe430f6ec MSVC builds: Use /opt:ref for release builds
glib-compile-resources have been updated to ensure that the symbols
generated are referred to, so that they will not be optimized out by the
linker in release builds.  We can change from /opt:noref to /opt:ref,
which should improve optimization a bit.
2015-11-12 18:16:33 +08:00
Chun-wei Fan
97b44e02a9 MSVC 2010+ builds: Do not explicitly use /LTCG
This partially reverts de16a4e.

As we now ensure that items using GResources and GConstructors are always
referenced so that the linker does not optimize them out in a default
Release build, we no longer need to enforce the use of /LTCG, so
/LTCG:incremental will work as well.
2015-11-12 15:53:47 +08:00
Chun-wei Fan
de16a4e07c MSVC release builds: Ensure that /LTCG is used
MSVC 2015 changed its default link-time code generation setting to
/LTCG:incremental, which causes problems if /opt:noref is to be used,
meaning that some code will be optimized out by the linker.

Avoid this situtation here by enforcing the use of /LTCG for MSVC 2010+
builds.
2015-10-23 10:33:41 +08:00
Chun-wei Fan
6f7029bb67 MSVC builds: Fix "install"
Use $(GlibEtcInstallRoot) when invoking glib-compile-schemas, as CopyDir
is not GlibInstallRoot for GTK+ (due to quoting issues), meaning that the
glib-compile-schemas tool may not be found in certain cases.

Issue pointed out by Ignacio Casal Quinteiro.
2015-10-12 23:22:35 +08:00
Matthias Clasen
c0e3b6ce71 fixup 2015-10-03 14:08:42 -04:00
Chun-wei Fan
975e1cc41c build/win32: Fix 'make -jN dist'
The recent changes to build/win32/vs9|10/Makefile.am fixed 'make distclean'
but broke 'make -jN dist', so fix that by listing the *.headers and using
that list as a dependency and to remove those files in one single command
right after we generate the gtk-install.vsprops template, so that we don't
have to worry about them in 'make distclean'.
2015-09-23 18:31:22 +08:00
Matthias Clasen
52dd61ac45 Fix distclean 2015-09-21 22:02:14 -04:00