summaryrefslogtreecommitdiff
path: root/README.msvc
blob: c5615e17cbc24b210f14b1d2827a696c138403fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Notes about building GDK-Pixbuf with Visual Studio
==================================================

Building GDK-Pixbuf on Visual Studio is now done via using Meson, which
gives us more flexible build configurations versus what we used to have
in the Visual Studio projects.

The following describes the steps and the items that are needed to build
GDK-Pixbuf with Visual Studio using Meson.  Visual Studio 2008 through
2017 are supported.

You will need a Python 3.5+ installation (and Ninja, unless using
--backend=vs, which is supported only on Visual Studio 2010, 2015 and
2017).  The Python interpreter and Ninja executable must be found in
your PATH.  You will also need Meson 0.45.0 or later.  Note that if
building the introspection files, the Python release series and build
configuration (Win32 (x86)/x86 (amd64/x86-64)) used must match the
release series and build configuration of the Python interpreter that
was used to build GObject-Introspection.

You will need the header and .lib's, along with their corresponding DLLs,
if applicable, for the following items.  Items marked with a * means that
their pkg-config (.pc) files are also needed, which normally comes as a
part of the dependency's build process.

-GLib*
-GObject-Introspection* (optional, for building introspection files)
-IJG JPEG or libjpeg-turbo (strongly recommended, use -Djpeg=false to disable)
-libpng (strongly recommended, use -Dpng=false to disable)
-libtiff (strongly recommended, use -Dtiff=false to disable)

1) Configure the build using Meson:
Set the PATH, LIB, INCLUDE and PKG_CONFIG_PATH environmental variables as
needed.  Run the following in a Visual Studio command prompt:

python $(PATH_TO_meson.py)\meson.py $(GDK_PIXBUF_SRCDIR) --buildtype=$(BUILD_CONFIG) --prefix=$(PREFIX) -Dman=false $(OTHER_OPTIONS)

For $(OTHER_OPTIONS), the following may be of interest, besides the png,
jpeg and tiff options.  Prefix each option with -D:

-builtin_loaders: list of image loaders that we want to build into
 the main GDK-Pixbuf DLL, or use 'all' to include all buildable image
 loaders into the GDK-Pixbuf DLL.  This would simplify deployment
 of GDK-Pixbuf for Windows.

-native_windows_loaders: Use GDI+ to load JPEG, TIFF and other image
 formats, without the need of IJG JPEG, libjpeg-turbo and libtiff.
 This support is considered experimental.  To build this image
 loader into the GDK-Pixbuf DLL, pass in 'windows' as part of the list
 passed into builtin_loaders or use 'all', in conjunction with using
 -Dnative_windows_loaders=true.

Use --backend=vs if using the Visual Studio 2010, 2015 or 2017 IDE is
desired.

2) Build GDK-Pixbuf using Ninja or the generated solution files.

3) Test and/or install the build using the "test" and  "install"
   targets respectively.

4) If building with Visual Studio 2008, you will need to do the run the following
   lines in the Visual Studio or SDK command prompt after building and installing.
   From the build directory:
   for /f %a in (*.dll.manifest) do if exist $(PREFIX)\bin\%~na /manifest %a /outputresource:$(PREFIX)\bin\%~na;2
   for /f %a in (*.exe.manifest) do if exist $(PREFIX)\bin\%~na /manifest %a /outputresource:$(PREFIX)\bin\%~na;1
   for /f %a in (*.exe.manifest) do if exist $(PREFIX)\libexec\installed-tests\gdk-pixbuf-2.0\%~na /manifest %a /outputresource:$(PREFIX)\libexec\installed-tests\gdk-pixbuf-2.0\%~na;1
   
   So that the security manifests that are generated can be embedded into the built
   DLLs and EXEs so that they can be usable.

See the following GNOME Live! page for a more detailed description of building
GDK-Pixbuf's dependencies with Visual Studio:

https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack