Lines Matching +full:windows +full:- +full:build +full:- +full:rules
1 Chun-wei Fan `<fanc999@yahoo.com.tw>`
12 import libraries) of GLib, Pango, GTK+ etc for Windows, go to
13 https://www.gtk.org/download/windows.php . They are for "native"
14 Windows meaning they use the Win32 API and Microsoft C runtime library
17 To build GLib on Win32, you can use either GCC ("MinGW") or the Microsoft
21 You can also cross-compile GLib for Windows from Linux using the
22 cross-compiling mingw packages for your distro.
24 Note that to just *use* GLib on Windows, there is no need to build it
27 On Windows setting up a correct build environment is very similar to typing
31 compilation related to Win32 in GLib-using code:
33 - `G_OS_WIN32` is defined when compiling for native Win32, without
37 - `G_WITH_CYGWIN` is defined if compiling for the Cygwin
42 - `G_PLATFORM_WIN32` is defined when either `G_OS_WIN32` or `G_WITH_CYGWIN`
48 Additionally, there are the compiler-specific macros:
49 - `__GNUC__` is defined when using GCC or Clang
50 - `__clang__` is defined when using Clang or Clang-CL
51 - `_MSC_VER` is defined when using MSVC or Clang-CL
54 …the [Universal CRT](https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?vi…
55 when building with Visual Studio. When using the MinGW-GCC toolchain, the CRT
66 the right compiler set up the right way. If you intend to use MinGW-GCC,
69 You should link to GLib using the `-mms-bitfields` GCC flag. This flag means
70 that the struct layout rules are identical to those used by MSVC. This is
71 essential if the same DLLs are to be usable both from gcc- and MSVC-compiled
74 ## Cross-CRT issues
89 …(https://docs.microsoft.com/en-us/cpp/c-runtime-library/potential-errors-passing-crt-objects-acros…
95 You can build GLib with MinGW-GCC, MSVC, or (experimentally) with Clang-CL.
99 - Install Python 3.6.x or newer, either 32-bit or 64-bit. We recommend enabling
101 - [Install Meson](https://mesonbuild.com/Getting-meson.html)
102 - Install the [Ninja build tool](https://github.com/ninja-build/ninja/releases), which can also be
105 - [git for Windows](https://gitforwindows.org/) is required, since Meson makes
108 ## Building with MinGW-GCC
111 MinGW-GCC toolchain installed, and build GLib [like any other Meson
112 project](https://mesonbuild.com/Quick-guide.html#compiling-a-meson-project).
118 To do a build using Meson, do the following:
120 - Open a Visual Studio (or SDK) command prompt that matches the Visual Studio
121 version and build platform (Win32/x86, x64, etc.) that will be used in all
124 - Create an empty directory/folder for the build inside your GLib sources
127 - Set up the build using Meson:
130 > meson .. --buildtype=<release|debug|debugoptimized> --prefix=<path> [--backend=vs]
133 Please see [the Meson docs](https://mesonbuild.com/Builtin-options.html#core-options)
134 for an explanation for `--buildtype`.
136 The path passed for `--prefix` need not to be on the same drive as where the
137 build is carried out, but it is recommended to use forward slashes for this
138 path. The `--backend=vs` option can be used if the Visual Studio project
141 - Build, test and install the build:
142 Run `ninja` to build, `meson test` to test and `meson install` to install the
143 build. If you used `--backend=vs`, instead of running `ninja`, you need to
150 ### C4819 build errors
152 If you are building GLib-based libraries or applications, or GLib itself
155 not be disregarded, as this likely means portions of the build are not being
160 To overcome this problem, please set your system's locale setting for non-Unicode to
161 English (United States), reboot, and restart the build, and the code should build
164 ### Support for pre-2012 Visual Studio
166 This release of GLib requires at least the Windows 8 SDK in order to be built
168 build GLib with Visual Studio 2008 nor 2010. People that still need to use
169 Visual Studio 2008 or 2010 should continue to use glib-2.66.x.