summaryrefslogtreecommitdiff
path: root/meson.build
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2863-copy-file-range' into 'main'Philip Withnall2023-05-091-0/+1
|\ | | | | | | | | | | | | gfile: Support copy_file_range() for file copies Closes #2863 See merge request GNOME/glib!3328
| * gfile: Support copy_file_range() for file copiesPhilip Withnall2023-05-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it can’t be used in all situations, it is a little bit faster than `splice()` in some situations, basically if the file system supports copy on write. In other situations it’s no slower than `splice()`. See `man copy_file_range` for the situations where it doesn’t work. In all of these situations, it will return an error, and the GLib code will fall through and try the existing `splice()` copy code instead. From my testing of `time gio copy A B` with a 9GB file, the `splice()` code path takes 22s, and the `copy_file_range()` code path takes 20s. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #2863
* | Check for linux/netlink.h buildabilitySamuel Thibault2023-05-091-1/+1
|/ | | | | | When cross-building with a non-Linux target, linux/netlink.h will not actually be buildable, even if distributions typically put it in /usr/include and thus exposed to the cross-compiler.
* docs: Update various broken/redirected linksPhilip Withnall2023-05-021-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch 'valgrind-variable' into 'main'Marco Trevisan2023-04-171-4/+9
|\ | | | | | | | | meson: Add glib_valgrind_suppressions variable to glib pkg-config file See merge request GNOME/glib!3361
| * meson: Add tests for generated pkg-config filesMarco Trevisan (Treviño)2023-04-171-1/+3
| | | | | | | | Ensure things are generated as we expect and avoid we regress on that.
| * meson: Add glib_valgrind_suppressions variable to glib pkg-config fileMarco Trevisan (Treviño)2023-04-141-3/+6
| | | | | | | | | | | | | | | | | | | | Various projects are running tests under valgrind, and they are using the GLib suppresions to avoid false-positive results. While this is stored in a well-known path for some years, and easy to figure out from the GLib prefix, it's better to expose it through a proper pkgconfig variable so that it's easy to get it from any build system.
* | Merge branch 'wip/jtojnar/wl-are-compiler-flags' into 'main'Philip Withnall2023-04-141-5/+5
|\ \ | | | | | | | | | | | | build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags See merge request GNOME/glib!3356
| * | build/gmodule-2.0.pc: Move compiler flags from Libs to CflagsJan Tojnar2023-03-311-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, `-Wl,--export-dynamic` was in `Libs` key of `gmodule-2.0.pc`, even though `-Wl` is a compiler flag, rather than a linker one. This caused issues with API reference builds in evolution-data-server, which passes the output of `pkg-config --libs` through `--ldflags` argument of `gtkdoc-scan`, which are forwarded unchanged to `ld`: ld: unrecognized option '-Wl,--export-dynamic' Let’s move the flag to `Cflags` so that the compiler can deal with it. https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/463
* | Merge branch 'meson-system-libintl-detection' into 'main'Philip Withnall2023-04-141-3/+4
|\ \ | | | | | | | | | | | | meson: Fix detection of a system-provided proxy-libintl See merge request GNOME/glib!3352
| * | meson: Fix detection of a system-provided proxy-libintlNirbheek Chauhan2023-03-261-3/+4
| | | | | | | | | | | | | | | | | | proxy-libintl defines ngettext() as a define in the header that points to the actual symbol in the library which is g_libintl_ngettext(). Same with bind_textdomain_codeset().
* | | Merge branch 'move-msvc-recommended-pragmas' into 'main'Philip Withnall2023-04-141-5/+1
|\ \ \ | | | | | | | | | | | | | | | | meson: Move msvc_recommended_pragmas.h to a subdirectory See merge request GNOME/glib!3340
| * | | meson: Move msvc_recommended_pragmas.h to a subdirectoryPhilip Withnall2023-03-211-5/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | It’s cluttering up the root directory. This should introduce no functional changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | | build: Post-release version bumpPhilip Withnall2023-04-141-1/+1
| |/ |/| | | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* | 2.76.12.76.1Philip Withnall2023-03-221-1/+1
|/ | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* 2.76.02.76.0Philip Withnall2023-03-101-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* 2.75.42.75.4Philip Withnall2023-03-031-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* gsocket: Use accept4 () for race-free setting of the close-on-exec flagMaciej S. Szmigiero2023-02-191-0/+1
| | | | | The code was already setting the close-on-exec flag for the new socket, just in a racy way.
* 2.75.32.75.3Philip Withnall2023-02-131-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch 'msort-cheri' into 'main'Philip Withnall2023-02-061-4/+0
|\ | | | | | | | | Allow using msort_r CHERI-enabled architectures See merge request GNOME/glib!3243
| * Allow using msort_r CHERI-enabled architecturesAlex Richardson2023-01-291-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | If we are sorting something that is a multiple of sizeof(void*), we have to ensure that we swap one pointer at a time since swapping using sub-pointer-size stores invalidate the pointers (pointers have a hidden validity tags that is invalidated when performing non-monotonic operations such as storing only part of the pointers). While touching this code also use G_ALIGNOF() instead of a macro that is generated at configure time. Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
* | gmem: Add g_free_sized() and g_aligned_free_sized()Philip Withnall2023-02-021-0/+2
|/ | | | | | | | | | | | | | | | | These wrap `free_sized()` and `free_aligned_sized()`, which are present in C23[1]. This means that user code can start to use them without checking for C23 support everywhere first. It also means we can use them internally in GSlice to get a bit of performance for the code which still uses it. See https://en.cppreference.com/w/c/memory/free_aligned_sized and https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2699.htm. [1]: Specifically, section 7.24.3.4 of the latest C23 draft at https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3088.pdf. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Merge branch 'threadpool-shared-thread-prios' into 'main'Michael Catanzaro2023-01-201-4/+0
|\ | | | | | | | | | | | | GThreadPool: Always use the thread-spawning thread for the global shared thread pool Closes #2769 See merge request GNOME/glib!3208
| * GThreadPool: Always use the thread-spawning thread for the global shared ↵Sebastian Dröge2023-01-171-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thread pool Setting the main thread's scheduler settings is not reliably possible, especially not if SELinux or similar mechanisms are used to limit what can be done. As such, get rid of all the complicated code that tried to do this better and use a separate thread for spawning threads for the global shared thread pool. These will always inherit the priority of the main thread (or rather the thread that created the first shared thread pool). Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2769
* | meson: Use 'tap' test protocol by defaultMarco Trevisan (Treviño)2023-01-171-0/+4
|/ | | | | | | | | Meson supports tap protocol results parsing, allowing us to track better the tests that are running (and the ones that are actually skipped) without manually parsing the test output. However this also implies that using the verbose mode for a test doesn't show its output by default (unless there are failures).
* 2.75.22.75.2Philip Withnall2023-01-061-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* meson: Don't accidentally pick up intl fallback in the first testNirbheek Chauhan2022-12-311-2/+3
| | | | | | | | | | | | | If proxy-libintl has already been configured before we get to glib, we will pick that up in dependency('intl'), which then does compiler checks on it. This was written to assume that the first check will not find a subproject for libintl, so force it with allow_fallback: false. Also update the proxy-libintl wrap file and get rid of the explicit subproject() call. Reported by Benjamin Gilbert at https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3172
* meson: Fix pcre static flag usage with a subprojectNirbheek Chauhan2022-12-311-1/+4
|
* meson: Don't use outdated 'fallback:' kwarg to dependency()Nirbheek Chauhan2022-12-311-2/+2
| | | | | | | | The mapping is done using the wrap file now. Also update the libffi and pcre2 subprojects at the same time. Reported by Benjamin Gilbert at https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3172
* meson: Don't accidentally pick up pcre2 fallback in the first testNirbheek Chauhan2022-12-301-2/+3
| | | | | | This test assumes that pcre2 is not provided by a subproject, so force it to be that. Explicitly allow fallback in the next check (although it's implied already).
* glib/gthread-posix: Conditionally use `futex` and/or `futex_time64` syscalls ↵Sebastian Dröge2022-12-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | as necessary and use the correct `struct timespec` definition On some systems only `futex_time64` exists (e.g. riscv32) while on others only `futex` exists (old Linux, 64 bit platforms), so it is necessary to check for both and try calling both at runtime. Additionally use the correct `struct timespec` definition. There is not necessarily any relation between the libc's definition and the kernel's. Specifically, the libc headers might use 64-bit `time_t` while the kernel headers use 32-bit `__kernel_old_time_t` on certain systems. To get around this problem we a) check if `futex_time64` is available, which only exists on 32-bit platforms and always uses 64-bit `time_t`. b) otherwise (or if that returns `ENOSYS`), we call the normal `futex` syscall with the `struct timespec` used by the kernel, which uses `__kernel_long_t` for both its fields. We use that instead of `__kernel_old_time_t` because it is equivalent and available in the kernel headers for a longer time.
* glib/gthread-posix: Use `cc.compiles()` instead of `cc.links()` for checking ↵Sebastian Dröge2022-12-131-1/+1
| | | | | | | | | for `__NR_futex` `cc.compiles()` is minimally faster. We only want to check here whether `__NR_futex` is defined and don't want to check anything at link-time.
* build: Add runtime_dir option to set runstatedir pathPhilip Withnall2022-12-021-0/+13
| | | | | | | | | | | | | | This will be used in upcoming commits to allow the previously-hardcoded `/run` path to be set at configure time. Most people will not want to change it from `/run`, even when building test builds, as otherwise interaction with system mounts and services will not work. Inspired by equivalent changes in dbus.git in their commit ff92efa389a57a5250c6996df6614234d4d462e0. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* build: Simplify construction of glib_localstatedirPhilip Withnall2022-12-021-5/+1
| | | | | | | | | | `join_paths()` automatically drops all preceding path elements if an argument to it is an absolute path. The `/` is a tidier synonym for `join_paths()`. This introduces no functional changes. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* gdbusaddress: Form default system dbus path using meson definitionsRoman Stratiienko2022-11-281-0/+2
| | | | | | | This is useful for systems where rootfs doesn't contain /var directory, e.g. on Android. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
* Revert "build: Bump Meson dependency to 0.64.0"Philip Withnall2022-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | This reverts commit 91f14cd058555f16b5abef1a577332921b08497b. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064
* Revert "build: Use fs.copyfile() instead of configure_file()"Philip Withnall2022-11-241-1/+0
| | | | | | | | | | | | | | | | | | | | | This reverts commit 19353017a786e90e00c29890ba6ca2ef88798df4. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064
* Revert "meson: Use gnome.mkenum_simple()"Philip Withnall2022-11-241-2/+0
| | | | | | | | | | | | | | | | | | | | | This reverts commit 756b424cce0ea7a0fe93b3a95c3529214ad70551. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064
* meson: Use gnome.mkenum_simple()Xavier Claessens2022-11-231-0/+2
| | | | | | Meson now uses find_program() to get glib-mkenum from glib instead of from system. That was already fixed at least in >=0.60 which is our current minimum requirement.
* Merge branch 'wip/pwithnall/meson-0.64' into 'main'Xavier Claessens2022-11-231-1/+2
|\ | | | | | | | | build: Bump Meson dependency to 0.64.0 See merge request GNOME/glib!3077
| * build: Use fs.copyfile() instead of configure_file()Philip Withnall2022-11-231-0/+1
| | | | | | | | | | | | | | | | Because Meson complains about using `configure_file(copy: true)`. Includes improvements by Xavier Claessens. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
| * build: Bump Meson dependency to 0.64.0Philip Withnall2022-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will fix dependency ordering issues found in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2917#note_1559190. As per `docs/meson-version.md`, we can depend on Meson ≤0.64.0 now as it’s in Debian Testing. The FreeBSD runners have to be changed to explicitly install the right version of Meson using `pip3`, as the system-installed version is not quite new enough. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1596257. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: !2917
* | meson: Compile some tests with multiple C standardsMarco Trevisan (Treviño)2022-11-221-0/+9
| | | | | | | | | | | | We need to ensure that all the expected macros and utilities are working with all the supported C standards, so just repeat the tests with all the ones the compiler supports.
* | build: Explicitly enable -Wmissing-field-initializersPhilip Withnall2022-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was previously only enabled (by default) on macOS, which led to code being committed which triggered warnings, as that CI job is not always run. Avoid that risk by always enabling the warning. The reasoning for using this warning is that explicit initialisation is clearer than implicit. We also want to support GLib’s public headers being used in projects which build with `-Werror=missing-field-initializers`, but can’t easily enable the warning for our public headers but not our internal code. So enable it everywhere. Make it a warning rather than an error, as there’s a risk that system header changes will trigger it in distro release builds, which would cause false build failures. By making it a warning, GLib developers can build with `-Werror` and promote it to an error, while distros can choose not to. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2812
* | build: Move -Wnonnull flag to meson.buildPhilip Withnall2022-11-181-0/+1
|/ | | | | | | | | It should be enabled in all builds, not just CI builds. Otherwise developers might miss it locally. This updates commit f11b96f255ee69f7ea5c51a2596f5cf1909a32b9. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* build: Post-release version bumpPhilip Withnall2022-11-101-1/+1
| | | | Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
* Revert "meson: Define G_OS_DARWIN when compiling under OSX or iOS"Philip Withnall2022-11-071-3/+0
| | | | | | | | This reverts commit e85635daa07e9c669ded75c476d67d02aa85c7c1. See the previous revert for rationale. Fixes: #2802
* build: Check for invalid parameter overriding on WindowsChun-wei Fan2022-11-031-0/+14
| | | | | | | | | | | | | | | Allow one to override the invalid parameter handler if we have the following items: * _set_invalid_parameter_hander() or _set_thread_local_parameter_handler() * _CrtSetReportMode() as a function or macro Currently, we are doing this on Visual Studio to allow GSpawn to work on Windows as well as having the log writer support color output, as we might be passing in file descriptors that are invalid, which will cause the CRT to abort unless the default invalid parameter handler is overridden.
* Merge branch 'wip/3v1n0/some-meson-fixmes' into 'main'Xavier Claessens2022-11-011-15/+20
|\ | | | | | | | | meson: Handle various build system FIXME's See merge request GNOME/glib!3012
| * meson: Remove stpcpy() workaround for old meson versions and windowsMarco Trevisan (Treviño)2022-10-261-10/+2
| | | | | | | | This is now supported by the meson version we depend on.