aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2020-04-29Fix symlink deletion with --wipe optionLaurent Pinchart1-1/+1
When wiping a build tree with --wipe, every entry in the build directory is removed with mesonlib.windows_proof_rmtree() for directories and mesonlib.windows_proof_rm() for other files. Symlinks to directories are considered directories, resulting in the former being called. This causes an exception to be raised, as the implementation calls shutil.rmtree(), which isn't allowed on symlinks. Fix this by using mesonlib.windows_proof_rm() for symlinks. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-28Clarified error message for test(). (#7040)Benjamin Frye1-1/+1
Changes the error message for test() so it now reports the expected and actual number of parameters. Fixes: #7029
2020-04-28gnome: Fix usage of gobject-introspection as subprojectXavier Claessens2-59/+42
2020-04-28Adding a conditional case in _guess_files to confirm that the complete path ↔georgev931-1/+16
is put together in even if a portion of the path is a location that exists. For instance if C:/Program Files (x86)/folder is passed to _guess_files, it would resolve to ['C:/Program Files', '(x86)/folder'] since C:/Program Files is an actual file location that can exist.
2020-04-28dependency: log cached or skipped dependencies with reference to modulesEli Schwartz1-5/+8
* dependency: log cached or skipped dependencies with reference to modules If the dependency is a special dependency which takes modules, the modules get cached separately and probably reference different pkg-config files. It's very plausible that we have multiple dependencies, using different modules. For example: Run-time dependency qt5 (modules: Core) found: YES 5.14.2 (pkg-config) Dependency qt5 skipped: feature gui disabled Obviously this makes no sense, because of course we found qt5 and even used it. The second line is a lot more readable if it shows this: Dependency qt5 (modules: Widgets) skipped: feature gui disabled Similar confusion abounds in the case where a module is found in the cache -- which module, exactly, has been found here: Dependency qt5 found: YES 5.14.2 (cached) Rewrite the dependency function to *consistently* pass around (and use!) the display_name even in cases where we know it isn't anonymous (this is just more correct anyway), and make it serve a dual purpose by also appending the list of modules just like we do for pretty-printing that a dependency has just been found for the first time. * fixup! dependency: log cached or skipped dependencies with reference to modules pointlessly cast modules to str, as they cannot be anything else. But we want to fail later on, with something more friendly than a stacktrace. boost/wx have special exceptions for people passing an integer there.
2020-04-28find_program: Fixes when the program has been overridden by executableXavier Claessens2-20/+42
- ExternalProgramHolder has path() method while CustomTargetHolder and BuildTargetHolder have full_path(). - The returned ExternalProgramHolder's path() method was broken, because build.Executable object has no get_path() method, it needs the backend. - find_program('overridden_prog', version : '>=1.0') was broken because it needs to execute the exe that is not yet built. Now assume the program has the (sub)project version. - If the version check fails, interpreter uses ExternalProgramHolder.get_name() for the error message but build.Executable does not implement get_name() method.
2020-04-28Merge pull request #7018 from dcbaker/junitJussi Pakkanen1-29/+145
mtest: Generate JUnit results for tests
2020-04-24backend/vs: Fix build when not all languages have pchPeter Harris1-10/+4
It is not unheard-of for a project to use pch for C++ but not for C (because C usually builds fast enough anyway, so it's not worth the developer overhead of maintaining the pch file). This code was trying to optimize the vcxproj file size by detecting "only one language", but it was only looking at the number of pch-languages defined. This is incorrect when pch is not defined for all languages in use. Instead of tweaking the optimization further, remove it. This makes the vs backend behave more like the ninja backend.
2020-04-24Adjust regex to handle cases such as C:/Program Files/foldergeorgev931-1/+1
2020-04-23mtest: Generate a JUnit xml result fileDylan Baker1-0/+113
JUnit is pretty ubiquitous, lots of services and results viewers understand it, in particular gitlab and jenkins know how to consume JUnit xml. This means projects using CI services can have their test results consumed automatically. Fixes: #6972
2020-04-23mtest: Store individual results for TAP testsDylan Baker1-21/+23
This will be used by the Junit writer
2020-04-23compilers: fix type issueAndrew Udvare1-1/+1
mesonlib.darwin_get_object_archs() only accepts a string argument so convert it.
2020-04-22mtest: Use textrwap.dedent for large blockDylan Baker1-8/+9
This allows editors like vim to properly fold the code, and makes it generally easier to read.
2020-04-22Issue: 7009: CMake/Centos7 Unable to find CMake even though it is installedAlexandre Lavigne1-1/+1
On some systems the binary 'cmake' for version 3 is named 'cmake3', therefor printing its version number prints: 'cmake3 version X.Y.Z' instead of 'cmake version X.Y.Z' This '3' digit in the middle breaks the regular expression extracting the version number. The following fix permit both way to work and the regexp to match the proper version number. Signed-off-by: Alexandre Lavigne <alexandre.lavigne@scality.com>
2020-04-21Use pkg_resource to find resources files (data)Dylan Baker2-4/+8
Doing this by hand is fraught with corner cases, and we're running into some of those problems already. setuptools pkg_resource is a well tested solution for not running into corner cases, and we already rely on setuptools to make our entry point scripts work, so we might as well make us of the other things it can solve for us. Fixes #6801
2020-04-21gtkdochelper.py: Ignore UnicodeEncodeError when printing outputChun-wei Fan1-1/+8
Windows cmd.exe consoles may be using a code page that might choke print() when we are outputting the output from calling gtk-doc. Let's just ignore the error when it happens and print as much as we could in this situation.
2020-04-21gtkdochelper.py: Support Windows cmd.exe consolesChun-wei Fan1-0/+1
On Windows, prepend the commands to call the gtk-doc scripts using the currently-used Python executable, since Windows cmd.exe consoles do not support shebang lines.
2020-04-21switch python2 %s for python3 .formatMichael6-18/+18
2020-04-20Compiler options per langJohn Ericson14-221/+389
A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
2020-04-20fix ninja version inconsistentMichael1-2/+2
2020-04-20compilers: Silence warning about gnu_inline with clangNirbheek Chauhan4-6/+18
The warning is due to a change in behaviour in Clang 10 and newer: https://releases.llvm.org/10.0.0/tools/clang/docs/ReleaseNotes.html#c-language-changes-in-clang This was already fixed for clang++, but not for clang for some reason. It was also fixed incorrectly; by adding `extern` instead of moving from `-Werror` to `-Werror=attributes`.
2020-04-17interpreter: Correctly ignore def files in build directoryXavier Claessens1-7/+7
See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/85.
2020-04-17cmake: Do not compile explicit header filesDaniel Mensinger3-15/+82
2020-04-17compilers: Honor <lang>_ld when linking C-like outputsOle André Vadla RavnÄs1-0/+4
2020-04-17Merge pull request #6980 from fooishbar/cmake-windows-system-lib-depsJussi Pakkanen1-2/+16
Fix CMake Windows system library deps
2020-04-17compilers: Update gnu_inline test to work correctly with Clang >= 10Dylan Baker1-0/+3
Which has changed the way it handles gnu_inline in C++.
2020-04-16backend: Fix file name confilcts by using the complete pathDaniel Mensinger1-2/+2
2020-04-15dependencies/cmake: Only use abs paths as link argsDaniel Stone1-1/+5
When taking library dependencies from CMake, we first attempt to look the dependency up in the target list, then fall back to treating it as a path, which we add if the path exists. As there is no check for whether or not the path is really a path, this can cause false positives; for example if a 'uuid' dependency was passed intending to be a target, but it cannot be found and the current directory also contains a file or directory named 'uuid', we will just include the string 'uuid' in library dependencies. This is particularly prevalent on Windows, where a system library called 'version' exists, and thanks to case insensitivity will match a file called 'VERSION' if found in the source root when running Meson from the source directory, or a generated file when running Meson from the build directory. Fix this check to only look up filesystem existence on absolute paths, not unqualified. This also adds a fallback warning in case an argument cannot be found, rather than silently falling back.
2020-04-15dependencies/cmake: Suffix bare library dependencies on WindowsDaniel Stone1-0/+9
On Windows, library dependencies can be passed with no prefix or suffix; rather than -lfoo or foo.dll, they can just be passed as 'foo'. CMake handles this and suffixes the library with '.lib' or '.dll', depending on the link mode. Do the same here, and if we've been passed an unqualified non-option bare name on Windows, add the appropriate suffix and pass it through to the linker. This fixes dependencies on system libraries.
2020-04-15dependencies/cmake: Add Windows/VS library regexDaniel Stone1-1/+2
When finding dependencies from CMake, use a smarter regex to determine whether or not a dependency is actually a link argument, and pass through Windows link arguments properly.
2020-04-14interpreter: find_program: Store program's name when not foundAriel D'Alessandro1-3/+3
Currently, looking for a nonexisting program using find_program() will return an NonExistingExternalProgram instace with the default name 'nonexistingprogram'. Let's store the target program's name in it, so it can be printed if needed. Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
2020-04-14interpreter: Show program's name on run_command error messageAriel D'Alessandro1-1/+1
Currently, the error message is printing the object itself. Showing the program's name is better. Signed-off-by: Ariel D'Alessandro <ariel@vanguardiasur.com.ar>
2020-04-13wrap: Add fallback urlsXavier Claessens1-8/+17
It can happen that a server is temporaly down, tarballs often have many mirrors available so we should be able to add at least one fallback mirror in wrap files.
2020-04-12Merge pull request #6963 from mensinda/cmFixCCmdJussi Pakkanen2-5/+36
cmake: some fixes for add_custom_command
2020-04-12Merge pull request #6943 from dcbaker/gdc-coverageJussi Pakkanen4-10/+10
Fix coverage generation with D compilers
2020-04-12Merge pull request #6958 from jon-turney/fix-name-prefix-explicit-defaultJussi Pakkanen1-6/+7
Fix library(name_prefix: [])
2020-04-12cmake: Preserve include directory order (fixes #6959)Daniel Mensinger1-11/+11
2020-04-12cmake: Capture stdout with UNIX pipesDaniel Mensinger1-1/+25
2020-04-12cmake: Fix custom command CMake list issueDaniel Mensinger1-4/+11
2020-04-12Fix VS Intellisense for projects which depend on LLVM found via CMake.Jesse Natalie1-0/+3
2020-04-11opts: Allow `-` and `not` in meson_options.txt (fixes #6948)Daniel Mensinger1-0/+10
2020-04-11Handle BuildTarget as custom_target() argument #6914Marc-André Lureau3-11/+11
2020-04-11Fix handling of library(name_prefix: [])Jon Turney1-6/+7
Adjust the handling of a name_prefix: [] kwarg to be the same as name_suffix: [] kwarg, i.e. identically to the case where it's omitted, so BuildTarget.prefix doesn't get set (so the default is used). Also clarify the error reported when a non-empty list is used.
2020-04-10compilers/d: Add missing method for dmd and ldcDylan Baker1-0/+3
This allows coverage to be generated, although we can't yet do anything useful with it.
2020-04-10compilers/d: Implement coverage for GDCDylan Baker1-4/+1
Since GDC a GNU compiler, we just need to pass the normal GNU options and coverage is generated. Related: ##5669
2020-04-10compilers: Move things out of clikeDylan Baker3-6/+6
One method belongs in the base Compiler class, the other belongs in the GnuLikeCompiler class.
2020-04-10compilers: disable b_sanitize on hurdPino Toscano1-1/+3
ASAN is not supported on the Hurd yet.
2020-04-10symbolextractor: add support for hurdPino Toscano1-1/+1
Use the GNU toolchain for that.
2020-04-10symbolextractor: rename linux_syms to gnu_symsPino Toscano1-2/+2
It is not specific to Linux but works with the GNU toolchain, so give it a better name. No functional changes.
2020-04-10Recognize Hurd as platform/OSPino Toscano2-0/+10