Commit Graph

86 Commits

Author SHA1 Message Date
Aleksey Filippov e4faf396e6 Do not use bare except [flake8]
Use more specific exception types where appropriate.
This patch does not change bare except calls if exception is re-raised.
2018-03-11 23:36:04 +00:00
Jon Turney 2f6ed47077 Fix various flake8 indentation reports
$ flake8 | grep -E '(E123|E127|E128)'
./run_unittests.py:1358:37: E127 continuation line over-indented for visual indent
./run_unittests.py:1360:37: E127 continuation line over-indented for visual indent
./mesonbuild/minit.py:311:66: E128 continuation line under-indented for visual indent
./mesonbuild/minit.py:312:66: E128 continuation line under-indented for visual indent
./mesonbuild/minit.py:313:66: E128 continuation line under-indented for visual indent
./mesonbuild/compilers/cpp.py:115:63: E127 continuation line over-indented for visual indent
./msi/createmsi.py:156:13: E123 closing bracket does not match indentation of opening bracket's line
./msi/createmsi.py:188:13: E123 closing bracket does not match indentation of opening bracket's line
2018-03-03 21:35:53 +00:00
Jussi Pakkanen ea3b54d402 Use include_directories for D impdirs.
Change the code to store D properties as plain data. Only convert them
to compiler flags in the backend. This also means we can fully parse D
arguments without needing to know the compiler being used.
2018-02-25 19:42:15 +02:00
Jussi Pakkanen dd74f3fb55 Hide banner when invoking csc. 2018-02-25 02:48:39 +02:00
Thibault Saunier c48b9594ff Add support for Visual Studio csc c# compiler 2018-02-25 01:10:52 +02:00
Matthias Klumpp 7e0db58f81 d: gdc: Implement proper dependency gen support
Older versions of GDC had broken support for the -MQ flag (resulting in
a compiler error). New versions of GDC have this issue fixed (some older
versions received a backport). Starting with GCC 7.1 we can assume
dependency generation to always work reliably.
2018-02-20 19:35:28 +02:00
Nirbheek Chauhan 8842839bb4 pkgconfig deps: Warn when a static library isn't found
A hard error makes this feature useless in most cases since a static
library usually won't be found for every library, particularly system
libraries like -lm. Instead, warn so the user can provide the static
library if they wish.

This feature will be expanded and made more extensible and more usable
in the future.

Closes https://github.com/mesonbuild/meson/issues/2785
2018-02-20 19:26:51 +02:00
Leon Krause 2fa44cf326 Enable default linker optimisations in MSVC release and minsize builds 2018-02-11 19:08:55 +02:00
Jon Turney 0774f319e8 Don't use --export-dynamic on Cygwin
After PR #2662, running test case common/125 shared module/ on Cygwin gets
me:

$ ninja -C _build
ninja: Entering directory `_build'
[7/7] Linking target prog.exe.
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE+ targets, did you mean --export-all-symbols?

Also, fix doc for correct version of first apperance.

Future work: Notwithstanding the hint that ld gives, these options are not
equivalent, and it's not clear we should be using it here:
--export-all-symbols is the default behaviour, and if the exports are
restricted by explicit annotations or a .def file, this option might be
overriding that...
2018-02-08 23:51:06 +02:00
Jussi Pakkanen bfa6c8d074
Merge pull request #2938 from acfoltzer/rust-cross-merge
Add cross-compilation support for `rustc`
2018-02-04 00:44:09 +02:00
Adam C. Foltzer 1d81efb03d Add cross-compilation support for `rustc`
This patch is largely modeled on the relatively-straightforward code
for Fortran cross-compilation, so there might be some intricacies
missing.
2018-01-29 15:47:05 -08:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Ting-Wei Lan ec50073644 Print warning when linker arguments are passed to has_argument
has_argument and other similar methods of compiler objects only support
checking compiler flags. If they are used to check linker flags, the
results are very likely to be wrong and developers should be warned.
2018-01-30 06:34:34 +11:00
Jussi Pakkanen dfd368d405
Merge pull request #2803 from dcbaker/wip/freebsd-fixes
various BSD fixes
2018-01-09 22:08:00 +02:00
Nikita Churaev de8018a17d Add `export_dynamic` argument to `executable`. (#2662) 2018-01-09 21:36:13 +02:00
Dylan Baker 4620bdd8b4 tests: fix rpath_uses_ORIGIN on dragonflybsd
Which always seems to prepend /usr/lib/gcc50 (or whatever version) to
the rpath, and $ORIGIN after that.
2018-01-06 13:49:34 -08:00
Dylan Baker 10a560a411 compilers: fix unittest "16 prebuilt shared" on dragonfly bsd 2018-01-06 13:49:34 -08:00
Alexey Stukalov 4f32d11e1b add Compiler.thread_flags() stub
fixes #2834
2017-12-30 23:21:42 +02:00
Nirbheek Chauhan 6f3e2a0a07 compilers: prefer C++ over objc in clink_langs
Otherwise we will try to use the objc compiler when linking projects
with both objc and C++.

Technically we should use the objc++ linker when doing this, but on
most (all?) systems the objc++ linker is `c++`, which is the same
as the C++ linker.

Closes https://github.com/mesonbuild/meson/issues/2468
2017-12-30 17:59:34 +02:00
Benjamin Redelings f3c182f07d Add whitespace around '+'. 2017-12-23 13:29:15 -08:00
Benjamin Redelings 907744d55e Fix linking with clang++ on linux if install_rpath. 2017-12-23 13:22:23 -08:00
Jussi Pakkanen b6dd50db31
Merge pull request #2791 from behlec/compiler-version
Add more version information to compiler
2017-12-20 20:42:01 +02:00
Christoph Behle c772841af7 Fix: More information for C compilers.
Add full version to gnu and icc C compiler.
2017-12-19 19:58:19 +01:00
Jussi Pakkanen 8eaa0a2732 Use -MD instead of -MMD for reliability. 2017-12-18 21:19:18 +02:00
Hemmo Nieminen d232a80e90 Allow value 'if-release' for b_ndebug project option. (#1896)
When set, NDEBUG will be automatically defined for for release builds but
not for other build types.
2017-12-17 21:06:06 +02:00
Christoph Behle 1f3b41021d More version information for Fortran. 2017-12-16 15:38:31 +01:00
Christoph Behle 5b83894b77 More version information for D 2017-12-16 15:07:08 +01:00
Christoph Behle 783263b9f4 More version information for C# 2017-12-16 15:05:09 +01:00
Christoph Behle c6acf75617 More version information for compilers.
See issue #2762
Adds full_version to class Compiler. If set full_version will be printed
additionally.
Added support for CCompiler and CPPCompiler
Added support for gcc/g++, clang/clang++, icc.
2017-12-16 14:52:08 +01:00
Ismael González d946b03496 Use LC_ALL=C in CCompiler.get_library_dirs
Use LC_ALL=C in CCompiler.get_library_dirs to fix wrong results with non
English locales.
2017-12-13 21:30:22 +02:00
Ernestas Kulik 448710ba96 Fix Vala thread flag breakage (#2756) 2017-12-11 20:28:42 +02:00
Dylan Baker fc547ad05e haiku: do not add pthread arguments
Haiku has pthreads, but they are part of the standard C library, and do
not need either special compiler or linker flags.
2017-12-07 09:35:12 -08:00
Jussi Pakkanen 4ae0cadb7f Renamed UserStringArrayOption to UserArrayOption for short. 2017-12-07 00:00:34 +02:00
Jussi Pakkanen c2d23dd678 Add C++17 flags to GCC and Clang. 2017-12-06 23:59:56 +02:00
Nirbheek Chauhan 45dbc0d30e find_library: Prefer .dll.a and .lib over .dll for shared
We can't know if the .lib is a static or import library, but that's
a problem in general too. The only way to figure out if a specific
file is an import or a static library is to dump its symbols and check
if it starts with __imp or not.

Even then, some libs are hybrid import and static, i.e., they contain
references to DLLs for some symbols and also provide implementations
for other symbols so this is a difficult problem.

Closes https://github.com/mesonbuild/meson/issues/2659
2017-12-03 10:06:11 +05:30
Jussi Pakkanen 554b484468
Merge pull request #2618 from mesonbuild/osxlinkerfixes
Fix many things have have been slightly broken in OSX
2017-12-03 02:25:44 +02:00
Ernestas Kulik e4f5fe1b35 vala: add stubs for thread flag methods
As the Vala compiler does not define thread_flags() and
thread_link_flags(), depending on threads in any capacity will cause Meson to
fail.

Fixes #2720.
2017-12-03 00:13:07 +02:00
Solomon Choina 2fdfb50da8 adding C++98 to versions that meson can support 2017-11-29 21:27:00 +02:00
Jussi Pakkanen fa6f01d096 Use absolute paths for rpaths on OSX. 2017-11-26 17:34:01 +02:00
Jussi Pakkanen 655137a74b Add headerpad linker argument on OSX. 2017-11-26 17:34:01 +02:00
Josh Soref 49f8d28ef5 spelling: overridden 2017-11-26 05:55:40 +00:00
Josh Soref 9dd4f047af spelling: occurrence 2017-11-26 05:55:13 +00:00
Jussi Pakkanen e51da1a34d
Merge pull request #2611 from mesonbuild/nirbheek/pkgconfig-msvc-static
Several fixes to pkg-config dependencies and the pkg-config module (try 3)
2017-11-15 22:51:34 +02:00
rkfg 87bf152e6e Fix #2620 2017-11-14 22:35:06 +02:00
Nirbheek Chauhan d2a250412c compilers: Improve manual library searching
We can now specify the library type we want to search for, and whether
we want to prefer static libraries over shared ones or the other way
around. This functionality is not exposed to build files yet.
2017-11-11 23:06:48 +05:30
Jussi Pakkanen 34d928a830 Better check for when address sanitizer is enabled. Closes #2590. 2017-11-09 21:14:42 +02:00
Alexis Jeandet dfab58772f Warn when no inc dir is found from parsing GNU compiler output
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-02 19:28:23 +01:00
Alexis Jeandet f15a57f31a Fix detection of include dirs with gnu compiler and non C locale
Auto detection was based on parsing gcc's output so we have to
ensure that it is always 'C'.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-01 15:08:23 +01:00
Niklas Claesson 09ccd0eeaa C/C++: Get default include dirs from compilers 2017-10-01 18:35:33 +02:00
Niklas Claesson 488e57332f VisualC: Add support for msvc toolset version 2017-10-01 18:35:33 +02:00