summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers.py
AgeCommit message (Collapse)Author
2017-03-10Add UNIX large file support via compiler always-argsNirbheek Chauhan
On 32-bit Linux and BSD, all libcs support this. Musl always enables it, and UClibc behaves like Glibc unless it's built without large file support (which is a terrible idea). http://wiki.musl-libc.org/wiki/FAQ#Q:_do_i_need_to_define_LARGEFILE64_SOURCE_to_get_64bit_off_t_.3F https://git.uclibc.org/uClibc/tree/include/features.h#n326 macOS now only ships 64-bit, so this is irrelevant there. 32-bit Windows and older versions of Bionic do not have transparent large file support and you must use lseek64, etc there, so this won't affect those. Newer Bionic versions behave like Glibc in theory. https://msdn.microsoft.com/en-us/library/1yee101t.aspx http://code.google.com/p/android/issues/detail?id=64613 Includes a linuxlike test for this. Closes https://github.com/mesonbuild/meson/issues/1032
2017-03-10compiler: Rename element argument of sizeof to typename.Haakon Sporsheim
2017-03-10compiler: Ensure prefix and dependencies are used for alignment.Haakon Sporsheim
This is now similar to how prefix and dependencies are used in all the other similar checks performed by the compiler.
2017-03-10compiler: Fix compute_int and sizeof for cross compilation.Haakon Sporsheim
sizeof now uses compute_int which again binary searches for correct value.
2017-03-09compiler: Add compute_int functionality.Haakon Sporsheim
Fixes #435
2017-02-21Detect GCC type on macOS for ObjC/C++ tooNirbheek Chauhan
These compilers are available in MinGW and can be built on macOS. More interestingly, `gcc` is a wrapper around `clang` on macOS, so we will detect the compiler type incorrectly on macOS without this.
2017-02-20Add auto option to b_colored when using Clang. Remove Clang version check ↵Rodrigo Lourenço
when enabling colored output.
2017-02-20Update minimum Clang version for colored outputRodrigo Lourenço
2017-02-19Add b_colorout option for Clang compilers.Rodrigo Lourenço
2017-02-02compilers: Don't use CompilerArgs() for sanity checksNirbheek Chauhan
It's only useful to use those when you have to override include dirs or library paths by appending them from various sources according to the priority order, or if the compiler args need to be converted from Unix/GCC-style to native (MSVC, for instance) style. Sanity checks match neither of these. Closes https://github.com/mesonbuild/meson/issues/1351
2017-01-28Add get_no_stdinc_args() for C++ tooNirbheek Chauhan
2017-01-27compilers: New class CompilerArgs derived from list()Nirbheek Chauhan
The purpose of this class is to make it possible to sanely generate compiler command-lines by ensuring that new arguments appended or added to a list of arguments properly override previous arguments. For instance: >>> a = CompilerArgs(['-Lfoo', '-DBAR']) >>> a += ['-Lgah', '-DTAZ'] >>> print(a) ['-Lgah', '-Lfoo', '-DBAR', '-DTAZ'] Arguments will be de-duped if it is safe to do so. Currently, this is only done for -I and -L arguments (previous occurances are removed when a new one is added) and arguments that once added cannot be overriden such as -pipe are removed completely.
2017-01-26Merge pull request #1328 from centricular/has-function-prefixJussi Pakkanen
Add prefix before including limits.h in has_function checks
2017-01-26compilers: Don't run built-in checks on MSVCNirbheek Chauhan
MSVC does not have built-ins, so this is totally useless. Instead, add a test for intrinsics to ensure that we do find them.
2017-01-26compilers: Fix has_function check for builtinsNirbheek Chauhan
Use a single check for both cases when we have includes and when we don't. This way we ensure three things: 1. Built-in checks are 100% reliable with clang and on macOS since clang implements __has_builtin 2. When the #include is present, this ensures that __builtin_func is not checked for (because of MSYS, and because it is faster) 3. We fallback to checking __builtin_func when all else fails
2017-01-26compilers: Add prefix before limits.h in has_function checksNirbheek Chauhan
prefix might define _GNU_SOURCE, which *must* be defined before your first include of limits.h, so we must define it first. There's not really any downsides to including limits.h after the prefix.
2017-01-26compilers: Pass -fpermissive on all C++ compilers except MSVCNirbheek Chauhan
2017-01-26compilers: Use named placeholders for string formattingNirbheek Chauhan
This makes it much clearer what each placeholder will be formatted to.
2017-01-26compilers: Fix builtin checks with clang on LinuxNirbheek Chauhan
Our "43 has function" test should also work with clang and icc on Linux, so enable them. Also detect builtins with __has_builtin if available, which is much faster on clang. There is a feature request for the same with GCC too: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66970
2017-01-23Use --coverage rather than hardcoding -lgcov. Closes #1311.Jussi Pakkanen
2017-01-24compilers: Use __has_include macro for has_header checksNirbheek Chauhan
If it's available, it's much much faster than doing #include + preprocess. Speeds up has_header checks by about 40% for me. Currently, only Clang supports this
2017-01-24compilers: Remove unnecessary arguments to super()Nirbheek Chauhan
2017-01-23Merge pull request #1320 from centricular/fix-llvmir-and-assemblyJussi Pakkanen
Fix llvmir and assembly
2017-01-21Fix targets with generated LLVM IR and Assembly sourcesNirbheek Chauhan
These two are also C-like sources, so don't ignore them in backends/ninjabackend.py:generate_target() when we call is_source() on the list of generated sources for that target. Closes #1318
2017-01-18cleanup: Remove redundant parenthesesMike Sinkovsky
2017-01-11style: [E1**] IndentationMike Sinkovsky
2017-01-11style: [E721] do not compare types, use 'isinstance()'Mike Sinkovsky
2017-01-03Merge pull request #1272 from mesonbuild/ignatenko/lintJussi Pakkanen
fix some linting errors
2017-01-04ifort: Derive from IntelCompiler base classNirbheek Chauhan
And fix the list of supported file suffixes, and use .f90 for all fortran tests since ifort, the Intel Fortran compiler ignores files ending with .f95, .f03, and .f08
2017-01-04icc: Always specify the language to use for PCH usageNirbheek Chauhan
Without this, ICC sometimes gets confused and thinks that the included header is a C header instead of a C++ header.
2017-01-04compilers.py: Use a common variable for warn argsNirbheek Chauhan
Makes it totally clear what extra args are added by each warning level.
2017-01-04compilers: gnu++03 is not a valid Clang C++ standardNirbheek Chauhan
It is not (no longer?) supported by Clang: error: invalid value 'gnu++03' in '-std=gnu++03'
2017-01-04icc: Fix C/C++ std options and add a unit test for themNirbheek Chauhan
Compiler versions 15.0 and later actually ignore invalid values for the -std= option unless `-diag-error 10159` is passed, so we need to put that in the unit test. I have tested this with versions 14.0.3, 15.0.6, 16.0.4, and 17.0.1. Would be great if someone could test with 13.x.y
2017-01-04ICC 17.0.0 working for Linux and Ninja Backend.Philipp Geier
Added IntelCompiler, IntelCCompiler and IntelCCompiler. environments.py has been changed to detect icc and icpc. ninjabackend changed for proper pch generation. ICC 17.0.0 does not support C++13 (that's why default arguments tests fails). Test 25 object extraction fails due to some unescaped whitespaces. Some test with vala fail because of successful build, although they should fail, as warning do not exit with failure.
2017-01-03fix 'unreachable code' warningsMike Sinkovsky
2017-01-03fix 'method signature does no match signature of overridden method'Mike Sinkovsky
2017-01-02style: fix E127 violationsIgor Gnatenko
E127: continuation line over-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-02style: fix E202 violationsIgor Gnatenko
E202: whitespace before ']' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-02fix for cross-builds targeting macosxMike Sinkovsky
2017-01-01style: fix E124 violationsIgor Gnatenko
E124: closing bracket does not match visual indentation Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E265 violationsIgor Gnatenko
E265: block comment should start with '# ' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E231 violationsIgor Gnatenko
E231: missing whitespace after ',' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E226 violationsIgor Gnatenko
E226: missing whitespace around arithmetic operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E225 violationsIgor Gnatenko
E225: missing whitespace around operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-31Fix space before :.Jussi Pakkanen
2016-12-23gdc: Make dependency check workMatthias Klumpp
The -fmake-deps command does not segfault anymore, and if it is used with "=" there will also be no "file not found" error.
2016-12-21d: Correctly set SONAME on D shared librariesMatthias Klumpp
All D compilers use the system linker, which is very convenient here.
2016-12-21ldc/dmd: Properly set warning argumentsMatthias Klumpp
2016-12-21Merge pull request #1233 from mesonbuild/wip/ignatenko/code-styleJussi Pakkanen
Trivial cleanups in code
2016-12-20Fix several more lint errorsNirbheek Chauhan
Found by Igor Gnatenko ************* Module mesonbuild.interpreter E:1232,33: No value for argument 'interp' in constructor call (no-value-for-parameter) ************* Module mesonbuild.dependencies E: 68, 4: An attribute defined in mesonbuild.dependencies line 39 hides this method (method-hidden) ************* Module mesonbuild.environment E: 26, 0: class already defined line 19 (function-redefined) E: 68,18: Undefined variable 'InterpreterException' (undefined-variable) E:641,39: Undefined variable 'want_cross' (undefined-variable) E:850,94: Undefined variable 'varname' (undefined-variable) E:854,94: Undefined variable 'varname' (undefined-variable) E:860,102: Undefined variable 'varname' (undefined-variable) E:863,94: Undefined variable 'varname' (undefined-variable) ************* Module mesonbuild.modules.gnome E:438,26: Undefined variable 'compilers' (undefined-variable)