aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
AgeCommit message (Collapse)AuthorFilesLines
2019-06-28Remove build host mixing warning on nativeJohn Ericson1-5/+0
There are two problems with this: - It has false positives when the code that trips it is conditional and no run on cross. - It confuses users who never wrote any `native` flags and don't care about cross. Fixes #5509
2019-06-27meson_exe: Don't assert that we need an exe_wrapper when we say we don't ↵Dylan Baker1-2/+4
need one Fixes cross compiling mesa from x86_64 -> x86 on an x86_64 system. Fixes #5567
2019-06-24meson: add cache for getting optionsMarcel Hollerbach1-0/+1
calling this function too ~60 sec. before, now 0.000435 sec.
2019-06-09Purge `is_cross` and friends without changing user interfacesJohn Ericson1-47/+41
In most cases instead pass `for_machine`, the name of the relevant machines (what compilers target, what targets run on, etc). This allows us to use the cross code path in the native case, deduplicating the code. As one can see, environment got bigger as more information is kept structured there, while ninjabackend got a smaller. Overall a few amount of lines were added, but the hope is what's added is a lot simpler than what's removed.
2019-06-09Use `env.machines.*` to avoid some `is_cross`John Ericson1-2/+2
This is a small example of the `is_cross` removal the that abstraction enables.
2019-06-03backend: refactor get_custom_target_provided_librariesMarcel Hollerbach1-3/+11
the problem here is, that get_custom_target_provided_libraries iterated over all generated sources of a target. In each output we check if this is a library or not. In projects like EFL we have added a lot of generated target to many different targets, so the iterating of the output is rather consistent, with this commit we drop from 19% of the time spending in get_custom_target_provided_libraries down to 3.51%.
2019-05-16Merge pull request #5395 from dcbaker/mtest-annotationsJussi Pakkanen1-2/+7
Mtest annotations and bug fixes
2019-05-15UserOption no longer has a name field.John Ericson1-3/+2
This avoids the duplication where the option is stored in a dict at its name, and also contains its own name. In general, the maxim in programming is things shouldn't know their own name, so removed the name field just leaving the option's position in the dictionary as its name.
2019-05-14backends: Annotate TestSerialisiationDylan Baker1-2/+7
Also, we should at some point decide whether we're going to use American spelling (serialize/serialization) or British (serialise/serialisation) because we have both, and both is always worse than one or the other.
2019-05-03compilers: Split C-Like functionality into a mixin classesDylan Baker1-2/+2
Currently C++ inherits C, which can lead to diamond problems. By pulling the code out into a standalone mixin class that the C, C++, ObjC, and Objc++ compilers can inherit and override as necessary we remove one source of diamonding. I've chosen to split this out into it's own file as the CLikeCompiler class is over 1000 lines by itself. This also breaks the VisualStudio derived classes inheriting from each other, to avoid the same C -> CPP inheritance problems. This is all one giant patch because there just isn't a clean way to separate this. I've done the same for Fortran since it effectively inherits the CCompiler (I say effectively because was it actually did was gross beyond explanation), it's probably not correct, but it seems to work for now. There really is a lot of layering violation going on in the Compilers, and a really good scrubbing would do this code a lot of good.
2019-05-02Merge pull request #5311 from mensinda/flake8PluginsJussi Pakkanen1-1/+3
Added flake8 plugins and some code fixes
2019-04-29Cleaned up `isinstance` usageTheQwertiest1-1/+1
2019-04-29Added custom_target[i] support for link_with and link_wholeTheQwertiest1-1/+3
2019-04-29Fix flake8-bugbear warningsDaniel Mensinger1-1/+3
2019-04-10Add support for VS2019. Closes #4640.Jussi Pakkanen1-0/+3
2019-04-08Merge pull request #5225 from dcbaker/threads-is-not-specialJussi Pakkanen1-2/+0
Threads is not special
2019-04-05dependencies/misc: don't special case threadsDylan Baker1-2/+0
Instad of having special casing of threads in the backends and everywehre else, do what we did for openmp, create a real dependency. Then make use of the fact that dependencies can now have sub dependencies to add threads.
2019-04-04backends/ninja: Add native files to rebuild dependenciesDylan Baker1-0/+1
Just like cross files.
2019-04-01Merge pull request #5103 from mesonbuild/linkcustomJussi Pakkanen1-0/+10
Can link against custom targets
2019-03-21Merge pull request #5116 from dcbaker/openmp-de-specializeJussi Pakkanen1-2/+0
dependencies/openmp: Don't special case OpenMP
2019-03-20mesonbuild: allow multiple --cross-file optionsRoss Burton1-2/+1
Just like --native-file, allow multiple --cross-file options. This is mostly unifying the logic between cross_files and config_files.
2019-03-19dependencies/openmp: Don't special case OpenMPDylan Baker1-2/+0
Currently we specialcase OpenMP like we do threads, with a special `need_openmp` method. This seems like a great idea, but doesn't work out in practice, as well as it complicates the opemp implementation. If GCC is built without opemp support for example, we still add -fopenmp to the the command line, which results in compilation errors. This patch discards that and treats it like a normal dependency, removes the need_openmp() method, and sets the compile_args attributes from the compiler. Fixes #5115
2019-03-18Can link against custom targets. Closes #4908.Jussi Pakkanen1-0/+4
2019-03-18Add test script to generate a static library with a custom target.Jussi Pakkanen1-0/+6
2019-03-02interpreter: add "protocol" kwarg to testPaolo Bonzini1-2/+3
This is the first step towards adding support for TAP.
2019-03-01auto generate msvc pch source file if none is provided by the userNicolas Schneider1-0/+17
2019-02-15Remove remaining cross-specific compiler-args codeJohn Ericson1-4/+4
Since the consolidation of flags in `compiler_options.*`, this cross/native special casing is not needed.
2019-02-02Never access environment.properties downstreamJohn Ericson1-5/+14
Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.
2019-01-29pep8 py37Michael Hirsch, Ph.D1-2/+2
2019-01-17custom_target: do not let install override build_by_defaultLuca Boccassi1-3/+5
A custom_target, if install is set to true, will always be built by default even if build_by_default is explicitly set to false. Ensure that this does not happen if it's set explicitly. To keep backward compatibility, if build_by_default is not set explicitly and install is true, set build_by_default to true. Fixes #4107
2019-01-07Calculate target paths correctly when workdir is set.Jussi Pakkanen1-1/+8
2019-01-06Fixed CI issuesDaniel Mensinger1-8/+17
2019-01-06Make custom command sources slightly more usefulDaniel Mensinger1-1/+7
2019-01-06Simplefied absolute path generationDaniel Mensinger1-0/+2
2019-01-06Doc updates and throw if no target type is setDaniel Mensinger1-7/+1
2019-01-06Ninja backend target introspectionDaniel Mensinger1-5/+9
2019-01-06Removed fallback detection logicDaniel Mensinger1-169/+15
2019-01-06Some code cleanupDaniel Mensinger1-24/+71
2019-01-06Moved the source and compiler generation to the backendDaniel Mensinger1-1/+145
2019-01-06Fixed tests and benchmarksDaniel Mensinger1-2/+5
2019-01-06Initial automatic target file generationDaniel Mensinger1-4/+6
2019-01-02Remove cross_info; cross file is parsed up front and discardedJohn Ericson1-12/+10
2019-01-02Get rid of `need_cross_compiler`John Ericson1-2/+0
Building a cross compiler (`build == host != target`) is not cross compiling. As such, it doesn't make sense to handle it under `is_cross_build`. (N.B. Building a standard library for a cross compiler would require cross compiling, but Meson has support to do such a thing as part of a compiler build currently.)
2018-12-29Introspection refactoringDaniel Mensinger1-0/+25
2018-11-08Add prefix option for link argsPhillip Cao1-0/+2
2018-11-04Detect clang-cl as msvc-like, not clang-likeJon Turney1-2/+2
Handle clang's cl or clang-cl being in PATH, or set in CC/CXX Future work: checking the name of the executable here seems like a bad idea. These compilers will fail to be detected if they are renamed. v2: Update compiler.get_argument_type() test Fix comparisons of id inside CCompiler, backends and elsewhere v3: ClangClCPPCompiler should be a subclass of ClangClCCompier, as well Future work: mocking in test_find_library_patterns() is effected, as we now test for a subclass, rather than self.id in CCompiler.get_library_naming()
2018-11-02extract_all_sources: Also include generated object filesXavier Claessens1-1/+7
Closes #4281.
2018-11-02meson: cache get_target_generated_dirMarcel Hollerbach1-0/+2
This reduces the build time about 2 sec. The result itself is not hard to calculate. However, persistent join calls with the same 2 strings are not that usefull. This also caused about 600'000 calls to get_target_dir, we are now down to 60'000 calls form this function to get_target_dir.
2018-10-24Fix flake8 whitespace reportsJon Turney1-1/+0
$ flake8 | grep -E '(E128|E203|E221|E226|E303|W291|W293)' ./mesonbuild/backend/backends.py:32:1: E303 too many blank lines (3) ./mesonbuild/modules/i18n.py:90:56: E128 continuation line under-indented for visual indent
2018-10-24Fix flake8 'imported but unused' reportsJon Turney1-2/+1
$ flake8 | grep F401 ./mesonbuild/minstall.py:15:1: F401 'gzip' imported but unused ./mesonbuild/backend/backends.py:26:1: F401 '..compilers.get_macos_dylib_install_name' imported but unused ./mesonbuild/backend/backends.py:29:1: F401 'functools.lru_cache' imported but unused ./mesonbuild/scripts/dist.py:27:1: F401 'mesonbuild.dependencies.ExternalProgram' imported but unused