diff options
author | Emmanuele Bassi <ebassi@gmail.com> | 2018-04-09 21:35:57 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-09 23:35:57 +0300 |
commit | e103675a3995f799d65a90595c62ad7f0ed4a088 (patch) | |
tree | d4c68bd616b3be87c009c451705fe97f20e4d55d | |
parent | 6dea1777743fe26173d9c674b0870790a7caae92 (diff) | |
download | meson-e103675a3995f799d65a90595c62ad7f0ed4a088.zip meson-e103675a3995f799d65a90595c62ad7f0ed4a088.tar.gz meson-e103675a3995f799d65a90595c62ad7f0ed4a088.tar.bz2 |
Never install the glib-mkenums generated C source (#3374)
* Never install the glib-mkenums generated C source
When using gnome.mkenums_simple() we end up installing the generated
C source file alongside the C header file, if `install_header` is set
to True. This is caused by mkenums_simple() acting as a wrapper for
mkenums() without template files; mkenums() won't be able to know if
we're generating the header or the source, and will use the presence
of `install_header` as the deciding factor as to whether the generated
file should be installed.
When generating the C source file, we should always unset the
`install_header` option to False, just like mkenums() expects.
Closes #3373
* Verify that mkenums_simple() does not install C sources
When asked to installed the generated C header file.
-rw-r--r-- | mesonbuild/modules/gnome.py | 6 | ||||
-rw-r--r-- | test cases/frameworks/7 gnome/installed_files.txt | 1 | ||||
-rw-r--r-- | test cases/frameworks/7 gnome/mkenums/meson.build | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 30364a6..9c73667 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -1046,6 +1046,12 @@ This will become a hard error in the future.''') raise MesonException( 'Sources keyword argument must be a string or array.') + # The `install_header` argument will be used by mkenums() when + # not using template files, so we need to forcibly unset it + # when generating the C source file, otherwise we will end up + # installing it + c_file_kwargs['install_header'] = False + header_prefix = kwargs.get('header_prefix', '') decl_decorator = kwargs.get('decorator', '') func_prefix = kwargs.get('function_prefix', '') diff --git a/test cases/frameworks/7 gnome/installed_files.txt b/test cases/frameworks/7 gnome/installed_files.txt index c7c704f..ac132ef 100644 --- a/test cases/frameworks/7 gnome/installed_files.txt +++ b/test cases/frameworks/7 gnome/installed_files.txt @@ -1,6 +1,7 @@ usr/include/enums.h usr/include/enums2.h usr/include/enums3.h +usr/include/enums5.h usr/include/marshaller.h usr/lib/?libgir_lib.so usr/lib/?libdep1lib.so diff --git a/test cases/frameworks/7 gnome/mkenums/meson.build b/test cases/frameworks/7 gnome/mkenums/meson.build index 9963455..44c21cb 100644 --- a/test cases/frameworks/7 gnome/mkenums/meson.build +++ b/test cases/frameworks/7 gnome/mkenums/meson.build @@ -123,6 +123,7 @@ enums4 = gnome.mkenums_simple('enums4', sources : 'meson-sample.h', enumexe4 = executable('enumprog4', 'main4.c', enums4, dependencies : gobj) enums5 = gnome.mkenums_simple('enums5', sources : 'meson-sample.h', + install_header : true, decorator : 'MESON_EXPORT', header_prefix : '#include "meson-decls.h"') enumexe5 = executable('enumprog5', main, enums5, dependencies : gobj) |