Repository navigation
Cleanup and modernize the templates and commands used by meson init - #14086
Conversation
| from mesonbuild.templates.sampleimpl import FileHeaderImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
| from mesonbuild.templates.sampleimpl import FileHeaderImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
| from mesonbuild.templates.sampleimpl import FileHeaderImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
| from mesonbuild.templates.sampleimpl import FileImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
|
|
||
| import typing as T | ||
|
|
||
| from .samplefactory import sample_generator |
Check failure
Code scanning / CodeQL
Module-level cyclic import
| from mesonbuild.templates.sampleimpl import FileHeaderImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
| from mesonbuild.templates.sampleimpl import FileHeaderImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
| from mesonbuild.templates.sampleimpl import FileImpl | ||
|
|
||
| if T.TYPE_CHECKING: | ||
| from ..minit import Arguments |
Check failure
Code scanning / CodeQL
Module-level cyclic import
|
The commit before the last is called "templates: use library() instead of shared_library()" but I only see variable name changes in it. Should it be renamed, or should it be squashed with the last commit? |
|
Derp. Squashed |
e02b02e to
5011501
Compare
|
C++ 14 is quite old, maybe it should be brought up to 20? |
|
Sure, I've added a patch to update both C and C++ standards to more recent versions |
Seems relevant. |
Intel's copyright was missing on these.
8d9cf6f to
f9ececa
Compare
| {ltoken}_dep = declare_dependency( | ||
| include_directories: include_directories('.'), | ||
| link_with : shlib) | ||
| link_with : shlib, |
There was a problem hiding this comment.
Sometimes we use foo : bar and sometimes foo: bar.
(I'd standardize on the former.)
There was a problem hiding this comment.
Gah! I thought I got them all. This is what I get for not doing a real search on [a-z]:
Without a version certain kinds of warnings will be suppressed, which is bad. I've picked 1.0 because it's pretty old, except for Rust where I've maintained the 1.3.0 requirement
Meson has added 'c' automatically to vala projects since 0.59, since the minimum version is now 1.0 this isn't needed
We have all kinds of formatting, different indents, different line break standards.
…roperty because abstractproperty is deprecated
This is going to allow us to re-use the implementation for the "create a new project" in the "add meson for an existing project" path.
f9ececa to
a2a629d
Compare
The command line value exists, and we'll want it soon.
This reduces duplication around the meson version, default options, etc. It also allows us to use the default initialization for libraries
a2a629d to
37d0d54
Compare
Presumably becase the compiler is too old? |
Is that really necessary? If C++14 was fine before, I'd assume it is fine now too. Absent weird cases like Google code. |
37d0d54 to
2180af4
Compare
|
I've dropped the C and C++ version changes as those were causing the bionic target to fail, and they're frankly not that interesting. If we really care that much I'd be more inclined to add a command line option to let the user pick their own version |
|
Also, this exercise made me realize how nice it is to have a real template engine like jinja or mako :/ |
Respect collected sources for `meson init` as well as --executable. This regressed in 9f0ac31 (part of mesonbuild#14086, it's easier to see how with the whole PR). Also, add subtests (distinguishing between empty directories and those with some file(s) within). We already had some of these but they weren't marked as such. Test `meson init` with a broken source file in the source directory as we should fail with that, not ignore the file. It's easier to test with a broken file than a working one as we can assert the build should fail, it'll pass with just the 1 example file we generate. Closes: mesonbuild#15286
Respect collected sources for `meson init` as well as --executable. This regressed in 9f0ac31 (part of mesonbuild#14086, it's easier to see how with the whole PR). Also, add subtests (distinguishing between empty directories and those with some file(s) within). We already had some of these but they weren't marked as such. Test `meson init` with a broken source file in the source directory as we should fail with that, not ignore the file. It's easier to test with a broken file than a working one as we can assert the build should fail, it'll pass with just the 1 example file we generate. Closes: mesonbuild#15286
Respect collected sources for `meson init` as well as --executable. This regressed in 9f0ac31 (part of #14086, it's easier to see how with the whole PR). Also, add subtests (distinguishing between empty directories and those with some file(s) within). We already had some of these but they weren't marked as such. Test `meson init` with a broken source file in the source directory as we should fail with that, not ignore the file. It's easier to test with a broken file than a working one as we can assert the build should fail, it'll pass with just the 1 example file we generate. Closes: #15286
Respect collected sources for `meson init` as well as --executable. This regressed in 9f0ac31 (part of #14086, it's easier to see how with the whole PR). Also, add subtests (distinguishing between empty directories and those with some file(s) within). We already had some of these but they weren't marked as such. Test `meson init` with a broken source file in the source directory as we should fail with that, not ignore the file. It's easier to test with a broken file than a working one as we can assert the build should fail, it'll pass with just the 1 example file we generate. Closes: #15286 (cherry picked from commit 9104bb6)
Respect collected sources for `meson init` as well as --executable. This regressed in 9f0ac31 (part of mesonbuild#14086, it's easier to see how with the whole PR). Also, add subtests (distinguishing between empty directories and those with some file(s) within). We already had some of these but they weren't marked as such. Test `meson init` with a broken source file in the source directory as we should fail with that, not ignore the file. It's easier to test with a broken file than a working one as we can assert the build should fail, it'll pass with just the 1 example file we generate. Closes: mesonbuild#15286
There's a couple of changes here. There's some just plain code cleanups, there's some formatting work, some replacement of deprecated methods, and some work to combine the templates and make them more powerful.
On that work I've done the following:
meson.override_dependency()when we create the dependency for subprojects<lang>_shared_argsinstead of shared_library