aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-11-06Don't use host pkg-config for native dependenciesLyude Paul7-1/+69
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-04Install files from the test added in 2ff69b20 to make sure it runsJon Turney3-1/+8
and make the test runnable :)
2018-11-04Update Python-module.mdLuca Weiss1-1/+1
Fix link to the disabler object
2018-11-04Merge pull request #4250 from jon-turney/windows-clang-clJussi Pakkanen31-128/+217
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-04Make use of get_argument_syntax() in another test caseJon Turney1-1/+6
2018-11-04azure: Remove MSVC tools from PATH for clang-cl jobJon Turney1-2/+9
Add Windows SDK tools to PATH (for rc). This requires INCLUDE to be set. lld-link doesn't seem to default to searching the correct directories, so LIB needs to be set. The easiest way to get the correct setting of INLCUDE and LIB env vars seems to be to import the VS env vars, then revert the PATH.
2018-11-04Handle llvm-lib in test common/143Jon Turney1-1/+2
2018-11-04Skip test common/123 if masm not foundJon Turney1-2/+5
'test cases/common/123 llvm ir and assembly' requires ML/ML64 (masm) on Windows. If we are using clang-cl, that might not be available, so skip test in that case.
2018-11-04Don't hardcode cl in test common/123Jon Turney1-1/+1
2018-11-04Handle only llvm-objdump being availableJon Turney1-3/+7
llvm-objdump currently doesn't appear to output the Windows subsystem, so that part of the test needs to be skipped.
2018-11-04Use compiler detector in detect_system_compiler()Jon Turney1-11/+15
Use the compiler detector in detect_system_compiler(), rather than trying to guess based on what it is the PATH (which could utterly fail e.g when CC env var is set) Note that this detection is only used by platform_fix_name() to interpret installed_files.txt
2018-11-04Fix a bug in test_compiler_detectionJon Turney1-0/+2
AR wasn't reset in the environment, so this test could fail if more than one language compiler was specified in the environment and the linker wasn't 'ar'
2018-11-04Use lld-link with clang-clJon Turney2-3/+9
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-04azure: Add clang-cl/ninja to matrixJon Turney2-1/+19
Note that Vs2017 tools are also in PATH for llvm build
2018-11-04Adjust more tests which need to know compiler typeJon Turney6-9/+11
2018-11-04Use 'rc' resource compiler with clang-cl toolchainJon Turney2-2/+2
The LLVM toolchain doesn't come with a Windows resource compiler at the moment. Use 'rc' from the Windows SDK.
2018-11-04Make use of get_argument_syntax() in test casesJon Turney7-17/+14
2018-11-04Accomodate clang-cl in test common/127Jon Turney1-1/+1
clang-cl does support '-Wmissing-include-dirs' (unlike msvc), but doesn't (currently) support '/ZI' (which is used by the default 'debug' buildtype), the presence of which will cause an 'unknown-argument' warning, which is treated as an error with 'Werror'. Adjust the default buildtype so this test can pass with clang-cl
2018-11-04Rewrite test common/100 manygen using get_argument_syntax()Jon Turney2-22/+15
Rewrite test common/100 manygen using get_argument_syntax(), so it treats clang-cl as cl, can handle only clang-cl being available, and try to make it a bit less convoluted.
2018-11-04Teach unit test test_compiler_detection about clang-clJon Turney1-0/+4
v2: Update for ClangClCcompiler class v3: Reorder compilers to simplify
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 Turney10-24/+48
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 Baker8-25/+112
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 Zanelli6-0/+63
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 Claessens2-1/+13
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-02Reformat Meson file for readability.Jussi Pakkanen1-10/+10
2018-11-02Make string division do path joining.Jussi Pakkanen5-5/+43
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-30Fix crlf line endingsDylan Baker3-90/+91
mark .icns files as binary so git will stop trying to fix the line endings, and recommit the remaining .crlf files
2018-10-29Fix merge file using an array. Closes #4424.Jussi Pakkanen2-1/+5
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 Claessens5-1/+23
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