Commit Graph

21 Commits

Author SHA1 Message Date
Alf Henrik Sauge 9ad5d0df4a Remove redundant backslash and fix white space issue 2022-08-26 17:12:40 -04:00
Alf Henrik Sauge 06bf9a5cda Fix purely white space issues reported by flake8 2022-08-26 17:12:40 -04:00
Eli Schwartz a49cd00d64 treewide: various cleanups to move imports for mypy into typechecking blocks
Along the way, add __future__ annotations where lacking.
2022-06-10 09:15:48 -04:00
Eli Schwartz b55349c2e9
dependencies: tighten type checking and fix cmake API violation for get_variable
dep.get_variable() only supports string values for pkg-config and
config-tool, because those interfaces use text communication, and
internal variables (from declare_dependency) operate the same way.

CMake had an oddity, where get_variable doesn't document that it allows
list values but apparently it miiiiiight work? Actually getting that
kind of result would be dangerously inconsistent though. Also, CMake
does not support lists so it's a lie. Strings that are *treated* as
lists with `;` splitting don't count...

We could do two things here:

- raise an error
- treat it as a string and return a string

It's not clear what the use case of get_variable() on a maybe-list is,
and should probably be a hard error. But that's controversial, so
instead we just return the original `;`-delimited string. It is probably
the wrong thing, but users are welcome to cope with that somehow on
their own.
2022-04-13 17:27:09 -04:00
Daniel Mensinger 589600cb51 cmake: Always use all compilers for LLVM (fixes #10249) 2022-04-12 18:25:38 -04:00
Jussi Pakkanen 219f40c1e4
Merge pull request #9743 from mensinda/cmakeGeneratorFixed
cmake: Add TARGET_ generator expression support (fixes #9305)
2022-03-07 16:12:19 +02:00
Eli Schwartz 07d9c72e17
flake8: fix wrong numbers of blank line separators 2022-02-16 18:19:13 -05:00
Eli Schwartz baecebda0e
flake8: fix typoed whitespace surrounding tokens 2022-02-16 18:19:13 -05:00
Eli Schwartz cf3a1d31f8 fix some flake8 violations for unused imports
And one undefined T.cast name in a file that isn't yet mypy-ready
anyway.
2022-01-27 10:48:01 -08:00
Daniel Mensinger 42843c4cf6
cmake: Add TARGET_ generator expression support (fixes #9305) 2022-01-23 13:22:59 +01:00
Eli Schwartz 140097faf0
port from embedded data to importlib.resources 2022-01-10 18:36:57 -05:00
Daniel Mensinger 45c5300496 cmake: Fix old style dependency lookup with imported targets
This also includes some refactoring, since the alternaticve would
have been to duplicate the huge traceparser target code block again.

fixes #9581
2021-12-01 21:03:36 +02:00
Jon Turney 61ca56422b cmake: Use find_library() on bare library names in cmake dependencies
Convert bare library names to a dependency linker argument using
find_library(), rather than hardcoding the MSVC transformation.
2021-11-20 08:29:50 -08:00
Daniel Mensinger ffc8721465 cmake: Add support for the Linux CMake registry (fixes #9418) 2021-10-24 09:57:06 -04:00
Daniel Mensinger 29c2b44a29 cmake: Implement support for interpreting link "keywords"
CMakes `target_link_libraries()` supports certain keywords to
only enable specific libraries for specific CMake configurations.
We now try our best to replicate this for Meson dependencies.

Fixes #9197
2021-10-06 16:43:59 +02:00
Daniel Mensinger f1614a6071 cmake: Warn if we could use IMPORTED CMake targets 2021-10-06 16:43:59 +02:00
Dylan Baker dd97ec607d dependencies: drop Dependency.methods and Dependency.get_methods()
Both of these are artifacts of the time before Dependency Factories,
when a dependency that could be discovered multiple ways did ugly stuff
like finding a specific dependency, then replacing it's own attributes
with that dependency's attributes. We don't have cases of that left in
the tree, so let's get rid of this code too
2021-07-13 16:43:14 -07:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Dylan Baker 0412bdd753 dependencies: Use a typing.NewType for Dependency.type_name
This allow mypy to catch cases where we accidently assign the dependency
name to the type_name, as it sees them as having different types (though
at runtime they're all strings).
2021-06-14 09:09:32 -07:00
Daniel Mensinger 71906c4bf8 typing: Fully annotate dependencies.cmake 2021-06-06 20:02:48 +03:00
Daniel Mensinger 95b70bcb97 deps: Split dependencies.base
Split the Factory and dependency classes out
of the base.py script to improve maintainability.
2021-06-03 10:23:27 -07:00