aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2018-11-08Add prefix option for link argsPhillip Cao2-0/+8
2018-11-08Get cross_args from the compiler rather than environment directlyPhillip Cao1-11/+7
This aligns with how the sanity checker gets the args
2018-11-08Add support for Renesas CC-RX toolchainPhillip Cao7-8/+275
2018-11-07Merge pull request #4356 from xclaesse/wipeJussi Pakkanen4-15/+100
Add --wipe command line option
2018-11-07mtest: Check that stdout is not None before seekingDylan Baker1-6/+10
As can be the case if additional_error is None and verbose is used. Fixes #4470
2018-11-06Add --wipe command line optionXavier Claessens1-6/+32
It is similar to --reconfigure but completely wipe the build directory first. It is intended to make easier to rebuild project when builddir somehow got corrupted. Fixes #3542.
2018-11-06Recover when coredata cannot be loadedXavier Claessens4-9/+68
Write command line options into a separate file to be able to reconfigure from scatch in the case coredata cannot be loaded. The most common case is when we are reconfiguring with a newer meson version. This means that we should try as much as possible to maintain backward compatibility for the cmd_line.txt file format. The main difference with a normal reconfigure is it will use new default options values and will read again environment variables like CFLAGS, etc.
2018-11-06Don't use host pkg-config for native dependenciesLyude Paul1-1/+0
When trying to cross-compile mesa on an aarch64 system, I noticed some strange behavior. Meson would only ever find the wayland-scanner binary in my host machine's sysroot (/mnt/amethyst): Native dependency wayland-scanner found: YES 1.16.0 Program /mnt/amethyst/usr/bin/wayland-scanner found: YES (/mnt/amethyst/usr/bin/wayland-scanner) It should be finding /usr/bin/wayland-scanner instead, since the wayland-scanner dependency is created as native. On closer inspection, it turned out that meson was ignoring the native argument passed to dependency(), and wuld always use the pkgconfig binary specified in my toolchain instead of the native one (/usr/bin/pkg-config): Native dependency wayland-scanner found: YES 1.16.0 Called `/home/lyudess/Projects/panfrost/scripts/amethyst-pkg-config --variable=wayland_scanner wayland-scanner` -> 0 Turns out that if we create a dependency() object with native:false, we end up caching the pkg-config path for the host machine in PkgConfigDependency.class_pkgbin, instead of the build machine's pkg-config path. This results causing in all pkg-config invocations for dependency() objects to use the host machine's pkg-config binary, regardless of whether or not 'native: true' was specified when the dependency() object was instantiated. So, fix this by never setting PkgConfigDependency.class_pkgbin for cross dependency() objects. Also, add some test cases for this. Since triggering this bug can be avoided by creating a dependency() objects with native:true before creating any with native:false, we make sure that our test has two modes: one where it starts with a native dependency first, and another where it starts with a cross dependency first. As a final note here: We currently skip this test on windows, because windows doesn't support directly executing python scripts as executables: something that we need in order to point pkgconfig to a wrapper script that sets the PKG_CONFIG_LIBDIR env appropriately before calling pkg-config. Signed-off-by: Lyude Paul <thatslyude@gmail.com>
2018-11-06Begin to factor out logic for getting binariesJohn Ericson1-45/+70
This gets the ball rolling, and doesn't depend on any of my other PRs in flight. Progress towards #4332
2018-11-06gnome: Require GObject-Introspection 1.58.1 for static librariesOlivier CrĂȘte1-2/+10
Introspecting non-libtool static libraries requires a gir-scanner fix which is only in 1.58.1 or later.
2018-11-05gnome: Use full path for static librariesOlivier CrĂȘte1-1/+6
Makes it a bit safer.
2018-11-05gnome: GIR works fine for static librariesOlivier CrĂȘte1-3/+5
g-ir-scanner works as well with static libraries as with dynamic
2018-11-04Merge pull request #4250 from jon-turney/windows-clang-clJussi Pakkanen11-51/+103
Add support for clang-cl on Windows
2018-11-04test: do not use PIPEMarcel Hollerbach1-12/+21
as instructed in the python docs, you should not use PIPE here. This can lead to deadlocks, with massive testsuite output. Which was the case for efl. For now the output of the tests is redirected into the a temp file, the content from there can then be used to fill the TestRun structure. This fixes test running problems in efl.
2018-11-04Use lld-link with clang-clJon Turney1-1/+6
Use lld-link dynamic linker with clang-cl Don't hardcode dynamic linker name in tests
2018-11-04Use llvm-lib as an alternative to libJon Turney1-4/+5
Detect llvm-lib as an alternative Windows static linker to lib
2018-11-04Qualify checks of self.version by self.id in VisualStudioC/CPPCompilerJon Turney2-10/+17
2018-11-04Use 'rc' resource compiler with clang-cl toolchainJon Turney1-1/+1
The LLVM toolchain doesn't come with a Windows resource compiler at the moment. Use 'rc' from the Windows SDK.
2018-11-04Teach VisualStudioCCompiler.get_pch_use_args() to handle clang-clJon Turney1-0/+2
It seems that clang-cl isn't quite compatible with cl in the way it handles pch, and when the precompiled header is used, the pathname of the header is needed, not just its filename. This fixes test\common\13 pch with clang-cl
2018-11-04Teach VisualStudioCCompiler.has_arguments() about clang-clJon Turney1-0/+2
When invoked as clang-cl to compile, it doesn't emit cl-compatible D9002 warnings about unknown options, but fortunately also supports -Werror-unknown-argument instead. When invoked to link, and using LINK, it does emit cl-compatible LNK4044 warnings about unknown options.
2018-11-04Only add link arguments when needed in Compiler object methodsJon Turney3-14/+20
Currently, ComplierHolder.determine_args() unconditionally adds the link arguments to the commmand, even if we aren't linking, because it doesn't have access to the mode (preprocess, compile, link) that _get_compiler_check_args() will use. This leads to command lines like: 'cl testfile.c /nologo /showIncludes /c /Fooutput.obj /Od kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib' which clang-cl considers invalid; MSVS cl accepts this, ignoring the unneeded libraries Change from passing extra_args down to _get_compiler_check_args(), to passing down a callback to CompilerHolder.determine_args() (with a bound kwargs argument), so it can consult mode and kwargs to determine the args to use.
2018-11-04Accomodate clang-cl /showIncludes outputJon Turney1-2/+3
Accomodate clang-cl /showIncludes output in detect_vs_dep_prefix(). clang-cl outputs lines terminated with \n, not \r\n v2: should invoke the detected compiler, not hardcode 'cl'
2018-11-04Detect clang-cl as msvc-like, not clang-likeJon Turney8-19/+47
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-03Add new compiler.get_argument_syntax methodDylan Baker3-0/+24
Some compilers try very had to pretend they're another compiler (ICC pretends to be GCC and Linux and MacOS, and MSVC on windows), Clang behaves much like GCC, but now also has clang-cl, which behaves like MSVC. This method provides an easy way to determine whether testing for MSVC like arguments `/w1234` or gcc like arguments `-Wfoo` are likely to succeed, without having to check for dozens of compilers and the host operating system, (as you would otherwise have to do with ICC).
2018-11-02interpreter: Don't warn about clang b_undef and b_sanitizer if sanitizer is noneDylan Baker1-1/+2
Since the "none" sanitizer isn't actually a sanitizer at all.
2018-11-02Cosmetic fix to failed required dependency reportingJon Turney1-1/+2
As mentioned in #4407, if dependency('boost') fails, the error message is 'Dependency "boost" not found, tried' (sic). Similar to line 1451 above, suppress reporting the tried methods returned by log_tried(), if the list is empty (as is the case with boost)
2018-11-02ninjabackend: add generated source files to jar compile target source listAurélien Zanelli1-0/+9
Otherwise, passing result of custom_target() to jar() target is ignored and won't be compiled resulting in build fail.
2018-11-02extract_all_sources: Also include generated object filesXavier Claessens1-1/+7
Closes #4281.
2018-11-02Fix incorrect checking of build machine for dependency availabilityJon Turney2-3/+3
Don't check the build machine to determine a dependency whose availability is static property of the host machine
2018-11-02Fail some impossible cross-detectionsJon Turney2-1/+14
Make some detections I can't see how to make work in a cross-environment fail.
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-11-02meson: performance optimizethe file objectMarcel Hollerbach1-0/+5
reduce the amount of access calls to the os. This safes ~1 sec. build time
2018-11-02Make string division do path joining.Jussi Pakkanen2-4/+11
2018-10-30Hoist gen_vs_module_defs_args from Gnu to GnuLike.Josh Gao1-10/+10
Support vs_module_defs when cross-compiling to Windows with clang. Fixes #4434.
2018-10-30Generalize gnulike-targeting-windows checks.Josh Gao3-6/+6
Replace several checks against GCC_MINGW or (GCC_MINGW, GCC_CYGWIN) with is_windows_compiler instead, so that clang and other gcc-like compilers using MinGW work appropriately with vs_module_defs, c_winlibs, and cpp_winlibs. Fixes #4434.
2018-10-29Fix merge file using an array. Closes #4424.Jussi Pakkanen1-0/+4
2018-10-29Print dependencies being used for compiler checksNirbheek Chauhan2-30/+49
It is a common idiom to look for a function or a specific type or a header in various locations/libraries, and it can be confusing to see the (seemingly) identical compiler check being done multiple times. Now we print the dependencies being used when a compiler check is run Before: Checking for function "fbGetDisplay": NO Checking for type "GLeglImageOES": YES Checking for function "asinh": YES After: Checking for function "fbGetDisplay" with dependency egl: NO Checking for type "GLeglImageOES" with dependencies glesv2, gl: YES Checking for function "asinh" with dependency -lm: YES
2018-10-29Rollback if an optional subproject failsXavier Claessens2-1/+16
If a subproject is not required and fails during its configuration, the parent project continues, but should not include any target or state set by the failed subproject. This fix ninja still trying to build targets generated by subprojects before they fail in their configuration. The 'build' object is now per-interpreter instead of being global. Once a subproject interpreter succeed, values from its 'build' object are merged back into its parent 'build' object.
2018-10-28get_base_compile_args: Add -fprofile-correction to -fprofile-useJan Alexander Steffens (heftig)1-2/+2
This allows using the imperfect profiles generated by multithreaded programs. Without the argument, GCC fails to load them. Clang just ignores the argument AFAICT. Fixes https://github.com/mesonbuild/meson/issues/2159
2018-10-28Fix bug in PerMachine constructorJohn Ericson1-1/+1
Don't make single element tuple
2018-10-27wrap: Check the directory key is a name and not a pathXavier Claessens1-0/+2
Closes #1413.
2018-10-27add support for `/permissive-`Nicole Mazzuca1-8/+21
We do this with `std_ver=vc++NM` - `vc++` does not add `/permissive-`, while `std_ver=c++NM` adds `/permissive-`.
2018-10-27dependencies/base: Replace windows path separators with \\\\Dylan Baker1-0/+3
Replace '\\' with \\\\ in config values args. Otherwise shlex will helpfully remove path separators on windows, resulting in values like: `-Ic:mydataishere` fixup! dependencies/base: Replace windows path separators with /
2018-10-26add implib support for ArmclangCompiler (#4420)pbl1-0/+14
2018-10-25Merge pull request #4326 from Ericson2314/per-machineJussi Pakkanen2-28/+167
Start leveraging MachineInfo with for_* methods
2018-10-25Detect powerpc processors on FreeBSD. Closes #4397.Jussi Pakkanen1-0/+13
2018-10-25compilers/c: Fix allow undefined link arg for PE/COFFMarvin Scholz1-0/+3
For PE/COFF it is not possible to allow undefined symbols, so do not try to use the option to do so. While gcc ld silently ignores it, this is not the case for the llvm linker. Fix #4415
2018-10-25depfixer: Do not try to fix rpaths of dllsMarvin Scholz1-0/+3
2018-10-25Purge unused argument. Closes #4407.Jussi Pakkanen1-1/+1
2018-10-24Fix flake8 whitespace reportsJon Turney2-2/+1
$ 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