summaryrefslogtreecommitdiff
path: root/README.win32
diff options
context:
space:
mode:
Diffstat (limited to 'README.win32')
-rw-r--r--README.win32100
1 files changed, 74 insertions, 26 deletions
diff --git a/README.win32 b/README.win32
index 4fda64ae0..1683d54b9 100644
--- a/README.win32
+++ b/README.win32
@@ -80,6 +80,11 @@ To overcome this problem, please set your system's locale setting for non-Unicod
English (United States), reboot, and restart the build, and the code should build
normally. See also this GNOME Wiki page [1] that gives a bit further info on this.
+In Visual Studio 2015 and later, the /utf-8 option is provided, which is set by the
+latest Meson releases when building GLib, and can be used in other project files
+that uses GLib to avoid the need of setting your system's locale setting for
+non-Unicode and the subsequent requirement to restart the system.
+
Building software that use GLib or GTK+
=======================================
@@ -150,14 +155,11 @@ library.
The DLL generated by either compiler is binary compatible with the
other one. Thus one either has to manually edit glibconfig.h
-afterwards, or use the supplied glibconfig.h.win32 which has been
-produced by running configure twice, once using gcc and once using
-MSVC, and merging the resulting files with diff -D.
+afterwards.
For MSVC7 and later (Visual C++ .NET 2003, Visual C++ 2005, Visual C++
2008 etc) it is preferred to use specific builds of GLib DLLs that use
-the same C runtime as the code that uses GLib. Such DLLs should be
-named differently than the ones that use msvcrt.dll.
+the same C runtime as the code that uses GLib.
For GLib, the DLL that uses msvcrt.dll is called libglib-2.0-0.dll,
and the import libraries libglib-2.0.dll.a and glib-2.0.lib. Note that
@@ -172,32 +174,78 @@ and libtool documentation.
Building with Visual Studio
===========================
-A more detailed outline of building GLib with its dependencies can
-now be found on the GNOME wiki:
+Meson is now the supported method of building GLib using Visual Studio.
+
+Note that you will need a libintl implementation, zlib, and libFFI, and
+optionally PCRE1, which should preferably be built with the same compiler
+that is now being used to build GLib. Ensure that their headers, .lib's
+and DLLs can be found in the paths specified by the INCLUDE, LIB and PATH
+envvars. The Meson build process will pull in a copy of the ZLib and the
+libFFI sources if they cannot be found, and will build an in-source copy
+of PCRE1 if PCRE1 cannt be found.
+
+One can also refer to the following page for building the dependencies:
https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack
-Please do not build GLib in paths that contain spaces in them, as
-this may cause problems during compilation and during usage of the
-library.
+You will also need the following items:
+-Python 3.6.x, you need the 32-bit version if you are building GLib
+ as a 32-bit/x86 build, or the amd64/x64 version for building 64-bit/x86-64
+ builds. You will then need to install or update Meson by using pip.
+-The Ninja build tool, required for Visual Studio 2008, 2012 and 2013 builds,
+ and optional for 2010, 2015 and 2017 builds, where Visual Studio projects
+ can be generated instead of the Ninja build files.
+-GIT for Windows is highly recommended, in the case where some required
+ dependencies are not found, and Meson makes use of GIT to download
+ the sources to build in the build process.
+
+To do a build using Meson, do the following:
+
+-Open a Visual Studio (or SDK) command prompt that matches the Visual Studio
+ version and build platform (Win32/x86, x64, etc.) that will be used in all
+ the following steps.
+
+-Create an empty directory/folder for the build. It needs to be in the same
+ drive as where your GLib sources are located (i.e. $(GLIB_SRCDIR)). cd into
+ that directory/folder.
+
+-Setup your PATH envvar:
+
+ set PATH=%PATH%;$(PYTHON_INSTALL_DIR);$(NINJA_DIR)
+
+ where PYTHON_INSTALL_DIR is where Python 3.6.x+ is installed to, and NINJA_DIR
+ is where your ninja executable can be found. The NINJA_DIR can be omitted if one
+ passes --backend=vs to the Meson configuration line, for Visual Studio 2010, 2015
+ and 2017 builds.
+
+-Configure the build using Meson:
+
+ python $(PYTHON_INSTALL_DIR)\scripts\meson.py $(GLIB_SRCDIR) --buildtype=$(build_configuration) --prefix=$(INSTALL_PREFIX) [--backend=vs]
+
+ Please see the Meson docs for an explanation for --buildtype, the path passed for
+ --prefix need not to be on the same drive as where the build is carried out, but
+ it is recommended to use forward slashes for this path. The --backend=vs can be
+ used if the Visual Studio project generator is preferred over using Ninja, for
+ Visual Studio 2010, 2015 and 2017 builds.
-In an unpacked tarball, you will find in build\win32\vs9 (VS 2008) and
-build\win32\vs10 (VS 2010) a solution file that can be used to build
-the GLib DLLs and some auxiliary programs under VS 2008 and VS 2010
-(Express Edition will suffice with the needed dependencies) respectively.
-Read the README.txt file in those folders for more
-information. Note that you will need a libintl implementation, zlib, and
-libFFI.
+-Build, test and install the build:
+ Run ninja (and ninja test and ninja install) or open the generated Visual Studio
+ projects to compile, test and install the build.
-If you are building from a GIT checkout, you will first need to use some
-Unix-like environment or run win32/setup.py,
-which will expand the VS 2008/2010 project files, the DLL resouce files and
-other miscellanious files required for the build. Run win32/setup.py
-as follows:
+Note that if building the sources with Visual Studio 2008, note the following
+additional items:
-$python win32/setup.py --perl path_to_your_perl.exe
+-You need to run the following lines from your build directory, to embed the manifests
+ that are generated during the build, assuming the built binaries are installed
+ to $(PREFIX), after a successful build/installation:
-for more usage on this script, run
-$python win32/setup.py -h/--help
+for /r %f in (*.dll.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f $(PREFIX)\bin\%~nf;2
+for /r %f in (*.exe.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f $(PREFIX)\bin\%~nf;1
-[1]: https://wiki.gnome.org/Projects/GTK%2B/Win32/MSVCCompilationOfGTKStack under "Preparations"
+-If building for amd64/x86_64/x64, sometimes the compilation of sources may seem to hang, which
+ is caused by an optimization issue in the 2008 x64 compiler. You need to use Task Manager to
+ remove all running instances of cl.exe, which will cause the build process to terminate. Update
+ the build flags of the sources that hang on compilation by changing its "/O2" flag to "/O1"
+ in build.ninja, and retry the build, where things should continue to build normally. At the
+ time of writing, this is needed for compiling glib/gtestutils.c, gio/gsettings.c and
+ gio/gsettingsschema.c