diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2017-09-29 11:52:06 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-09-07 11:52:15 -0700 |
commit | 51e9db370a0ebccaf220e171c3444a0f2c4e1723 (patch) | |
tree | 1636eec99faf01aeb6e08c0753fa4503fdbdbb38 /mesonbuild/compilers/compilers.py | |
parent | 8ca463f9f1d432d059c12da42a18fd13b4604b57 (diff) | |
download | meson-51e9db370a0ebccaf220e171c3444a0f2c4e1723.zip meson-51e9db370a0ebccaf220e171c3444a0f2c4e1723.tar.gz meson-51e9db370a0ebccaf220e171c3444a0f2c4e1723.tar.bz2 |
Add method to check for C/C++ function attributes
It's fairly common on Linux and *BSD platforms to check for these
attributes existence, so it makes sense to me to have this checking
build into meson itself. Autotools also has a builtin for handling
these, and by building them in we can short circuit cases that we know
that these don't exist (MSVC).
Additionally this adds support for two common MSVC __declspec
attributes, dllimport and dllexport. This implements the declspec
version (even though GCC has an __attribute__ version that both it and
clang support), since GCC and Clang support the MSVC version as well.
Thus it seems reasonable to assume that most projects will use the
__declspec version over teh __attribute__ version.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r-- | mesonbuild/compilers/compilers.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 36507b0..88e9bce 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1137,6 +1137,10 @@ class Compiler: def get_gui_app_args(self, value): return [] + def has_func_attribute(self, name, env): + raise EnvironmentException( + 'Language {} does not support function attributes.'.format(self.get_display_language())) + GCC_STANDARD = 0 GCC_OSX = 1 GCC_MINGW = 2 |