| Age | Commit message (Collapse) | Author |
|
Comparing the implementation of build_subdir with
https://github.com/mesonbuild/meson/pull/12258, both of them introduced
a similar separation between srcdir and builddir. There were some
differences in the choices of srcdir vs builddir; this commit tries to
identify which are bugs in which implementation, and get the best of
both worlds.
|
|
|
|
|
|
This really isn't a list because it's not homogenous data, it's really
`tuple[str, str | None] | None`, but we're using list length to decide
what to do with it, and that makes for strict null issues, as an
accurate annotation would be `list[str | None]`, which would require a
lot of `is not None` checking. By using a tuple we don't need to keep
checking length, which is more expensive than null checking.
To ensure correctness I annotated some things in the VS backend
|
|
They are duplicates of what is already in compilers and have no state. Just
use compilers.
Fixes: #15082
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
No one is accessing backend.interpreter anymore, get rid of it
to avoid future temptations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The interpreter's build_def_files are the only remaining piece
of interpreter state used by the backend. Compute it once
and store it in build, using a property to ensure that it's initialized
and accessed correctly.
This also removes one of the cases in which introspection uses the
interpreter object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
There are a lot of spelled out unions for these types, lets reduce that
number
|
|
```
-Found 438 errors in 3 files (checked 3 source files)
+Found 402 errors in 3 files (checked 3 source files)
```
|
|
|
|
|
|
As of Swift 5.9, C++/Objective-C++ code can be mixed with Swift, and
C++ APIs can be imported to Swift. However, this must be explicitly
enabled, as it is disabled by default.
Xcode 15 introduces a new setting for this, so only set it on Xcode 15
and above.
|
|
Allow CUDA to completely override the -std arguments but not the rest.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This is an old method, that is now just a wrapper around the OptionStore
method, that doesn't add any value. It's also an option related method
attached to the CoreData instead of the OptionStore, so useless and a
layering violation.
|
|
|
|
|
|
Xcode treats this dict value as a space-separated string, any spaces in
the path will make the path invalid by splitting it into pieces.
Split out header path processing into a helper function.
|
|
|
|
Reorder compile args so that target has a chance to override options set
by its dependencies.
Fix piling up of custom target include paths.
|
|
Add a check before using an `appleframeworks` to make sure it was found.
This fixes an exception in meson while encountering an optional dep for
the target.
|
|
These errors can make reading comments and documentation
unnecessarily confusing for users and contributors who
do not speak English as their first language.
|
|
|
|
Refactor duplicated quoting code for XCode backend
|
|
CustomTargetIndex
Fix incorrect map access to custom_target_output_buildfile in CustomTargetIndex
case. Map keys are file names with the path appended, but the used keys were
just the file name. This led to crashes.
|
|
A follow-up to the PbxDictItem refactoring. This removes extra type
casting and string formatting before inserting values to the PbxDict.
|
|
Review suggestion
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
|
|
XCode project file contains dictionary-like structures. Strings for the
mapped values have to be quoted if these include special characters.
Previously this quoting was happening in-place, before adding a new
value to the dictionary. This produce big amounts of boilerplate
error-prone code. For example if there are targets whose names contain special
characters (grpc++ in my case), produced file will be invalid.
This moves checking and quoting subroutine to the PbxDictItem class,
eliminating the need to do this on the caller side.
[Kin](https://github.com/Serchinastico/Kin) tool was used to validate
produced PBXProj files.
|
|
This was removed on Xcode 9, so only generate it for Xcode 8.3.3
and lower.
|
|
Some settings require "objectVersion" to be set to a certain value or
Xcode will not use it. To fix this, we set it to the highest possible
value, determined by the detected version of Xcode. We also set
"compatibilityVersion", but mainly so it lines up with "objectVersion".
At the same time, we should not be generating Xcode 3.2-compatible
projects by default anyway.
|
|
This will allow for generating project files more specific to certain
versions of Xcode without breaking compatibility.
|
|
`func(value: dict = None)` is invalid, it must be `func(value: dict |
None = None)`, or in our older syntax: `T.Optional[T.Dict] = None`
|
|
|
|
|
|
Xcode 14 has dropped the legacy build system, forcing us to use the
new one introduced in Xcode 9. The new system requires that we conform
to its "clean build folder" behavior, or clean operations fail.
CMake achieves this by setting other variables instead of SYMROOT, so
we follow that approach while retaining our current behavior as much
as possible.
Ref: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7730
|
|
If there are any specified, the build target that generates them must
be added as a dependency.
|
|
Some backends may need to use its own target directories instead of
our default one. For this, introduce an optional argument "targetdir"
that will still use our default one when not specified.
|
|
Currently, the backend has "x86_64" hardcoded as the architecture,
which breaks cross compiling and compiling normally on arm64. Fix
this by setting it to the host machine's CPU architecture instead.
|
|
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.
This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.
SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
|
|
Down from 120 to 44 mypy errors.
|
|
mypy will complain if backends.Backend has a lru_cache wrapped method,
but it is overridden in XCodeBackend with a method that isn't cached.
This is almost certainly a sign that we should be caching it here too
anyway. The generic backend cache was added years ago via an
intimidating commit f39d2cc3bfa1dd4983cbe5adfb6c6e87dd09d684 which
claims that it reduced call time from 60s to 0.000435s and that this was
specifically due to getting a coredata option every single time. This is
probably workload dependent, but getting an option is *not* nearly as
cheap as a throwaway function call.
|
|
|
|
The only backend that can return values in generate() is ninja, so this
was useless cruft.
|
|
|
|
Xcode does not recognize our private directories, nor does it ever
try to generate them. Instead, just import the build directories
for each swift dependency.
This fixes linking between swift targets when they are in their own
subdirectories, as they will have different build directories in that
case.
|
|
|
|
Without this, any build directory with a space in it was enough to
make Xcode fail to open the project due to parsing errors.
|
|
|
|
When generating aggregated targets, custom targets were not being
checked for dependencies when they should have.
Fixes passing swift test case 4 (generate).
|
|
This fixes syntax highlighting on Xcode when viewing those files.
|
|
This must be explicitly set in Xcode or it will not be able to compile
mixed targets successfully. This is not needed for pure Swift targets.
Set a new variable "is_swift" so finding the bridging header does not
take O(n^2) time.
Fixes passing swift test case 5 (mixed) with Xcode backend.
|