diff options
-rw-r--r-- | docs/markdown/Users.md | 11 | ||||
-rw-r--r-- | mesonbuild/backend/backends.py | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/c_function_attributes.py | 3 | ||||
-rw-r--r-- | test cases/common/203 function attributes/meson.build | 48 | ||||
-rw-r--r-- | test cases/common/203 function attributes/meson_options.txt | 7 | ||||
-rw-r--r-- | test cases/common/203 function attributes/test.json | 10 | ||||
-rw-r--r-- | test cases/common/93 selfbuilt custom/meson.build | 14 |
7 files changed, 65 insertions, 32 deletions
diff --git a/docs/markdown/Users.md b/docs/markdown/Users.md index 874d8e4..bfc8a7a 100644 --- a/docs/markdown/Users.md +++ b/docs/markdown/Users.md @@ -51,14 +51,14 @@ topic](https://github.com/topics/meson). - [GNU FriBidi](https://github.com/fribidi/fribidi), the open source implementation of the Unicode Bidirectional Algorithm - [Graphene](https://ebassi.github.io/graphene/), a thin type library for graphics - [Grilo](https://git.gnome.org/browse/grilo) and [Grilo plugins](https://git.gnome.org/browse/grilo-plugins), the Grilo multimedia framework - - [GStreamer](https://cgit.freedesktop.org/gstreamer/gstreamer/), multimedia framework + - [GStreamer](https://gitlab.freedesktop.org/gstreamer/gstreamer), multimedia framework - [GTK+](https://gitlab.gnome.org/GNOME/gtk), the multi-platform toolkit used by GNOME - [GtkDApp](https://gitlab.com/csoriano/GtkDApp), an application template for developing Flatpak apps with Gtk+ and D - [GVfs](https://git.gnome.org/browse/gvfs/), a userspace virtual filesystem designed to work with the I/O abstraction of GIO - [Hardcode-Tray](https://github.com/bil-elmoussaoui/Hardcode-Tray), fixes hardcoded tray icons in Linux - [HelenOS](http://helenos.org), a portable microkernel-based multiserver operating system - [HexChat](https://github.com/hexchat/hexchat), a cross-platform IRC client in C - - [IGT](https://cgit.freedesktop.org/xorg/app/intel-gpu-tools/), Linux kernel graphics driver test suite + - [IGT](https://gitlab.freedesktop.org/drm/igt-gpu-tools), Linux kernel graphics driver test suite - [inih](https://github.com/benhoyt/inih) (INI Not Invented Here), a small and simple .INI file parser written in C - [Irssi](https://github.com/irssi/irssi), a terminal chat client in C - [iSH](https://github.com/tbodt/ish), Linux shell for iOS @@ -71,7 +71,7 @@ topic](https://github.com/topics/meson). - [Ksh](https://github.com/att/ast), a Korn Shell - [Lc0](https://github.com/LeelaChessZero/lc0), LeelaChessZero is a UCI-compliant chess engine designed to play chess via neural network - [libcamera](https://git.linuxtv.org/libcamera.git/), a library to handle complex cameras on Linux, ChromeOS and Android - - [Libdrm](https://cgit.freedesktop.org/drm/libdrm/), a library for abstracting DRM kernel interfaces + - [Libdrm](https://gitlab.freedesktop.org/mesa/drm), a library for abstracting DRM kernel interfaces - [Libepoxy](https://github.com/anholt/libepoxy/), a library for handling OpenGL function pointer management - [libfuse](https://github.com/libfuse/libfuse), the reference implementation of the Linux FUSE (Filesystem in Userspace) interface - [Libgit2-glib](https://git.gnome.org/browse/libgit2-glib), a GLib wrapper for libgit2 @@ -97,7 +97,7 @@ format files - [OpenH264](https://github.com/cisco/openh264), open source H.264 codec - [OpenHMD](https://github.com/OpenHMD/OpenHMD), a free and open source API and drivers for immersive technology, such as head mounted displays with built in head tracking - [OpenTitan](https://github.com/lowRISC/opentitan), an open source silicon Root of Trust (RoT) project. - - [Orc](http://cgit.freedesktop.org/gstreamer/orc/), the Optimized Inner Loop Runtime Compiler + - [Orc](https://gitlab.freedesktop.org/gstreamer/orc), the Optimized Inner Loop Runtime Compiler - [OTS](https://github.com/khaledhosny/ots), the OpenType Sanitizer, parses and serializes OpenType files (OTF, TTF) and WOFF and WOFF2 font files, validating and sanitizing them as it goes. Used by Chromium and Firefox - [Outlier](https://github.com/kerolasa/outlier), a small Hello World style meson example project - [Pacman](https://git.archlinux.org/pacman.git/tree/), a package manager for Arch Linux @@ -131,7 +131,8 @@ format files - [wlroots](https://github.com/swaywm/wlroots), a modular Wayland compositor library - [wxFormBuilder](https://github.com/wxFormBuilder/wxFormBuilder), RAD tool for wxWidgets GUI design - [xi-gtk](https://github.com/eyelash/xi-gtk), a GTK+ front-end for the Xi editor - - [Xorg](https://cgit.freedesktop.org/xorg/xserver/), the X.org display server (not the default yet) + - [Xorg](https://gitlab.freedesktop.org/xorg/xserver), the X.org display server (not the default yet) + - [X Test Suite](https://gitlab.freedesktop.org/xorg/test/xts), The X.org test suite - [zathura](https://github.com/pwmt/zathura), a highly customizable and functional document viewer based on the girara user interface library and several document libraries - [Zrythm](https://git.zrythm.org/cgit/zrythm), a cross-platform digital audio workstation using GTK+ 3 diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index afd8487..138708d 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -468,8 +468,8 @@ class Backend: source = 'meson-generated_' + os.path.relpath(rel_src, targetdir) else: if os.path.isabs(rel_src): - # Not from the source directory; hopefully this doesn't conflict with user's source files. - source = os.path.basename(rel_src) + # Use the absolute path directly to avoid file name conflicts + source = rel_src else: source = os.path.relpath(os.path.join(build_dir, rel_src), os.path.join(self.environment.get_source_dir(), target.get_subdir())) diff --git a/mesonbuild/compilers/c_function_attributes.py b/mesonbuild/compilers/c_function_attributes.py index e5de485..3b9fdf9 100644 --- a/mesonbuild/compilers/c_function_attributes.py +++ b/mesonbuild/compilers/c_function_attributes.py @@ -127,4 +127,7 @@ CXX_FUNC_ATTRIBUTES = { 'static int (*resolve_foo(void))(void) { return my_foo; }' '}' 'int foo(void) __attribute__((ifunc("resolve_foo")));'), + # Clang >= 10 requires the 'extern' keyword + 'gnu_inline': + 'extern inline __attribute__((gnu_inline)) int foo(void) { return 0; }', } diff --git a/test cases/common/203 function attributes/meson.build b/test cases/common/203 function attributes/meson.build index 9ec948f..9817309 100644 --- a/test cases/common/203 function attributes/meson.build +++ b/test cases/common/203 function attributes/meson.build @@ -82,30 +82,30 @@ if ['gcc', 'intel'].contains(c.get_id()) endif endif +if get_option('mode') == 'single' + foreach a : attributes + x = c.has_function_attribute(a) + assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a)) + x = cpp.has_function_attribute(a) + assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a)) + endforeach -foreach a : attributes - x = c.has_function_attribute(a) - assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a)) - x = cpp.has_function_attribute(a) - assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a)) -endforeach - -win_expect = ['windows', 'cygwin'].contains(host_machine.system()) -foreach a : ['dllexport', 'dllimport'] - assert(c.has_function_attribute(a) == win_expect, - '@0@: @1@'.format(c.get_id(), a)) - assert(cpp.has_function_attribute(a) == win_expect, - '@0@: @1@'.format(cpp.get_id(), a)) -endforeach - -message('checking get_supported_function_attributes') -if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) - multi_expected = attributes + win_expect = ['windows', 'cygwin'].contains(host_machine.system()) + foreach a : ['dllexport', 'dllimport'] + assert(c.has_function_attribute(a) == win_expect, + '@0@: @1@'.format(c.get_id(), a)) + assert(cpp.has_function_attribute(a) == win_expect, + '@0@: @1@'.format(cpp.get_id(), a)) + endforeach else - multi_expected = [] -endif + if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) + multi_expected = attributes + else + multi_expected = [] + endif -multi_check = c.get_supported_function_attributes(attributes) -assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)') -multi_check = cpp.get_supported_function_attributes(attributes) -assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)') + multi_check = c.get_supported_function_attributes(attributes) + assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)') + multi_check = cpp.get_supported_function_attributes(attributes) + assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)') +endif diff --git a/test cases/common/203 function attributes/meson_options.txt b/test cases/common/203 function attributes/meson_options.txt new file mode 100644 index 0000000..4a1d87c --- /dev/null +++ b/test cases/common/203 function attributes/meson_options.txt @@ -0,0 +1,7 @@ +option( + 'mode', + type : 'combo', + choices : ['single', 'parallel'], + value : 'single', + description : 'Test the one at a time function or many at a time function.' +) diff --git a/test cases/common/203 function attributes/test.json b/test cases/common/203 function attributes/test.json new file mode 100644 index 0000000..d06a24a --- /dev/null +++ b/test cases/common/203 function attributes/test.json @@ -0,0 +1,10 @@ +{ + "matrix": { + "options": { + "mode": [ + { "val": "single" }, + { "val": "parallel" } + ] + } + } +} diff --git a/test cases/common/93 selfbuilt custom/meson.build b/test cases/common/93 selfbuilt custom/meson.build index fc5d916..3cc3906 100644 --- a/test cases/common/93 selfbuilt custom/meson.build +++ b/test cases/common/93 selfbuilt custom/meson.build @@ -17,7 +17,7 @@ test('maintest', main) lib = library('libtool', 'tool.cpp') -checkarg = executable('checkarg', 'checkarg.cpp') +checkarg = executable('checkarg', 'checkarg.cpp', native : true) ctlib = custom_target('ctlib', output : 'ctlib.out', @@ -25,3 +25,15 @@ ctlib = custom_target('ctlib', command : [checkarg, lib], build_by_default : true, ) + +if meson.is_cross_build() and meson.has_exe_wrapper() + checkarg_host = executable('checkarg_host', 'checkarg.cpp') + + ctlib_host = custom_target( + 'ctlib_host', + output : 'ctlib.host.out', + capture : true, + command : [checkarg_host, lib], + build_by_default : true, + ) +endif |