summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Moved the source and compiler generation to the backendDaniel Mensinger2019-01-061-1/+145
|
* Fixed tests and benchmarksDaniel Mensinger2019-01-061-2/+5
|
* Initial automatic target file generationDaniel Mensinger2019-01-061-4/+6
|
* Remove cross_info; cross file is parsed up front and discardedJohn Ericson2019-01-021-12/+10
|
* Get rid of `need_cross_compiler`John Ericson2019-01-021-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.)
* Introspection refactoringDaniel Mensinger2018-12-291-0/+25
|
* Add prefix option for link argsPhillip Cao2018-11-081-0/+2
|
* Detect clang-cl as msvc-like, not clang-likeJon Turney2018-11-041-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()
* extract_all_sources: Also include generated object filesXavier Claessens2018-11-021-1/+7
| | | | Closes #4281.
* meson: cache get_target_generated_dirMarcel Hollerbach2018-11-021-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.
* Fix flake8 whitespace reportsJon Turney2018-10-241-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
* Fix flake8 'imported but unused' reportsJon Turney2018-10-241-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
* Remove implicit compression of man pagesMichał Górny2018-10-201-1/+1
| | | | | | | | | Remove the code responsible for implicitly compressing manpages as .gz files. It has been established that manpage compression is a distro packager's task, with existing distros already having their own implementations of compression. Fixes #4330
* Add 'b_pie' compiler optionXavier Claessens2018-10-201-0/+2
| | | | | On Android executables must be position independent, many distributions enable it by default too for security reasons.
* os.path.relpath() can fail on WindowsJon Turney2018-10-101-2/+2
| | | | | | | | | If builddir and sourcedir have different drive letters, a relative path doesn't exist, and os.path.relpath fails with a ValueError exception. This just fixes the places which are hit by test cases in a simple-minded way. There are several other uses of os.path.relpath(), which might be suspect.
* backends: allow running host arch binaries on compatible build machinesDylan Baker2018-10-041-4/+6
| | | | | | | | | | | | | Meson 0.48.0 some validation for using compiled binaries in custom targets and generators, which is nice. It didn't take into account though that as long as the OS is the same, some architectures support running a related architecture natively (x86_64 can run x86 natively, for example). Fortunately we already have a method for covering this case available through the Environment class. Fixes #4254
* build: generate the mappings in the TargetsMarcel Hollerbach2018-10-011-27/+1
| | | | | | | | | Before, the mappings has been created over all the links, while it actaully only used the Shared or Static Targets. This structure now is tree like structured and cached, thus the results can be computed a lot faster. The generator step generate_install is now for EFL from 6 sec. down to 0.3s. Which improves the overall build time from ~20 sec. to ~14 sec.
* build: move default_install_dir to the Target classesMarcel Hollerbach2018-10-011-29/+2
| | | | | | there is a huge amount of isinstance calls, this reduces the amount of these calls while splitting up a rather big function. It also assosiates every target type with theire default install directory.
* backend: Make sure to normalize paths before checking if it is a system dirThibault Saunier2018-09-281-0/+1
| | | | | | | | | | | | Otherwise if we for some reason get '/usr/lib/../lib' in there we end up saying it is not a system path. And for some reason here I got: ``` $ pkg-config --libs libffi  148  ST 117   hotdoc -L/usr/lib/../lib -lffi ```
* Sprinkle functools.lru_cache() in a few more placesNirbheek Chauhan2018-09-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This improves the backend generation time for gst-build from 7.4s to 6.6s. This is probably all the low-hanging fruit we can get, further improvements will probably require refactoring, moving to pathlib.Path or reimplementing CompilerArgs: 222045 0.551 0.000 1.324 0.000 compilers.py:666(__iadd__) 3691 0.230 0.000 0.885 0.000 ninjabackend.py:99(write) 233560 0.441 0.000 0.701 0.000 posixpath.py:75(join) 882 0.141 0.000 0.636 0.001 backends.py:509(generate_basic_compiler_args) 256301 0.248 0.000 0.576 0.000 compilers.py:562(_can_dedup) 37369 0.035 0.000 0.466 0.000 compilers.py:652(extend_direct) 74650 0.067 0.000 0.431 0.000 compilers.py:641(append_direct) 158153 0.089 0.000 0.405 0.000 ninjabackend.py:129(<lambda>) 845 0.064 0.000 0.391 0.000 ninjabackend.py:279(get_target_generated_sources) 58161 0.070 0.000 0.317 0.000 backends.py:217(get_target_generated_dir) 216825 0.175 0.000 0.275 0.000 ninjabackend.py:48(ninja_quote) 845 0.058 0.000 0.255 0.000 ninjabackend.py:2289(guess_external_link_dependencies) 845 0.068 0.000 0.239 0.000 backends.py:793(get_custom_target_provided_libraries) 52101 0.030 0.000 0.237 0.000 compilers.py:716(append) 1319326 0.231 0.000 0.231 0.000 {built-in method builtins.isinstance} 1189117 0.229 0.000 0.229 0.000 {method 'startswith' of 'str' objects} 3235 0.102 0.000 0.228 0.000 compilers.py:614(to_native) Note: there are 845 build targets.
* mesonbuild: move subdir generation along link dep generationMarcel Hollerbach2018-09-111-6/+5
| | | | | | | | | | | | | | The problem with the earlier position of the generation code was, that the results could not be cached, because the list of all link_deps was overall different. However, it shared a special kind of subsets with other build build targets. Generating the set of subdirs that are required for linking, alongside with the link dependencies brings the possibility of caching this. This reduces the buildting from 1 min. in efl down to 20 sec. And reduces the amount of 30872534 calls down. this saves ~40 sec.
* backends: save up the dylib generated namesMarcel Hollerbach2018-09-111-1/+7
| | | | this saves about 6 sec.
* Improve D link argument handlingGoaLitiuM2018-09-061-5/+5
|
* Added "native" kwarg to add_XXX_args. Closes #3669.Jussi Pakkanen2018-08-221-2/+2
|
* find_library: Use _build_wrapper to get library dirsBruce Richardson2018-08-221-5/+5
| | | | | | | | | | This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes https://github.com/mesonbuild/meson/issues/3881
* Convert buildtype to optimization and debug options (#3489)Jussi Pakkanen2018-08-181-0/+2
|
* Don't require an import library for shared modulesNirbheek Chauhan2018-08-091-3/+5
| | | | | | | | | | Shared modules may be resource-only DLLs, or might automatically self-initialize using C constructors or WinMain at DLL load time. When an import library is not found for a shared module, just print a message about it instead of erroring out. Fixes #3965
* Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacksJussi Pakkanen2018-07-311-10/+21
|\ | | | | Be more permissive about not-found exe_wrapper
| * cross: Be more permissive about not-found exe_wrappernirbheek/exe-wrapper-compiler-fallbacksNirbheek Chauhan2018-07-091-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to immediately try to use whatever exe_wrapper was defined in the cross file, but some people generate the cross file once and use it for several projects, most of which do not even need an exe wrapper to build. Now we're a bit more resilient. We quietly fall back to using non-exe-wrapper paths for compiler checks and skip the sanity check. However, if some code needs the exe wrapper, f.ex., if you run a built executable using custom_target() or run_target(), we will error out during setup. Tests will, of course, continue to error out when you run them if the exe wrapper was not found. We don't want people's tests to silently "pass" (aka skip) because of a bad CI setup. Closes https://github.com/mesonbuild/meson/issues/3562 This commit also adds a test for the behaviour of exe_wrapper in these cases, and refactors the unit tests a bit for it.
| * cross: Use ExternalProgram for cross-file exe_wrapperNirbheek Chauhan2018-07-091-5/+8
| | | | | | | | | | | | We already have code to fetch and find binaries specified in a cross file, so use the same code for exe_wrapper. This allows us to handle the same corner-cases that were fixed for other cross binaries.
* | Merge pull request #3898 from mesonbuild/vsinstallJussi Pakkanen2018-07-271-1/+223
|\ \ | | | | | | Add install target to VS
| * | Added install target to VS. Closes #3841.vsinstallJussi Pakkanen2018-07-221-1/+4
| | |
| * | Moved install data file generation to base class.Jussi Pakkanen2018-07-171-1/+220
| |/
* | Make the rpath order deterministic. (#3932)Rafael Ávila de Espíndola2018-07-251-1/+1
|/
* Rename clike_langs to clink_langs for clarityNirbheek Chauhan2018-06-201-1/+1
| | | | | | | D is not a 'c-like' language, but it can link to C libraries. The same might be true of Rust in the future and Go when we add support for it. This contains no functionality changes.
* Correctly substitute the internal @BUILD_ROOT@ token with MSVC backendJon Turney2018-06-181-1/+1
| | | | | To me, this looks like a mistake in 976c9abc, but perhaps there's something I don't understand going on here.
* Deprecate `build_always`, add `build_always_stale`Alex Hirsch2018-06-181-1/+1
| | | | | | | | | | | | | | Since `build_always` also adds a target to the set of default targets, this option is marked deprecated in favour of the new option `build_always_stale`. `build_always_stale` *only* marks the target to be always considered out of date, but does *not* add it to the set of default targets. The old behaviour can still be achieved by combining `build_always_stale` with `build_by_default`. fixes #1942
* macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan2018-06-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
* backends: Don't exclude system libraries for PATHNirbheek Chauhan2018-06-071-3/+3
| | | | | We reuse the same function for generating PATH, and we don't want to exclude system paths there for obvious reasons.
* backends: Don't hardcode system library pathsNirbheek Chauhan2018-06-071-5/+12
| | | | | | Lookup the library paths using the available compilers instead. This makes the code work on non-Linux platforms too.
* Fix issues found by flake8Xavier Claessens2018-06-061-1/+1
|
* Move <lang>_args to coredata.compiler_optionsXavier Claessens2018-06-061-1/+1
|
* Add prog/lib dirs from the mingw cross-compiler to PATHNirbheek Chauhan2018-06-051-7/+12
| | | | | These directories contain DLLs that the executable may need, such as libstdc++-6.dll, libwinpthread, etc.
* Automatically add cross-mingw root and sysroot bindir to WINEPATHNirbheek Chauhan2018-06-051-10/+23
| | | | | This ensures that all the system DLLs required by executables such as libstdc++-6.dll can be found out of the box and tests can run
* Set WINEPATH when running serialized executablesNirbheek Chauhan2018-06-051-2/+6
| | | | | | | | | | When the exe runner is `wine` or `wine32` or `wine64`, etc. This allows people to run tests with wine. Note that you also have to set WINEPATH to point to your custom prefix(es) if your tests use external dependencies. Closes https://github.com/mesonbuild/meson/issues/3620
* test extra paths: add extra paths for all build targetsMathieu Duponchelle2018-06-021-2/+2
|
* test serialisation: determine windows extra paths ..Mathieu Duponchelle2018-06-021-0/+2
| | | | | | | .. for executable arguments too. This makes it possible to pass an executable to a test, which can then run it in an appropriate environment.
* backends: Also accept dylibs while finding RPATHsNirbheek Chauhan2018-05-241-1/+3
|
* backends: Simplify loop getting rpaths for bundled libsNirbheek Chauhan2018-05-241-17/+19
| | | | No functionality changes
* backends: Use a set while gathering RPATHsNirbheek Chauhan2018-05-241-8/+4
|