Commit Graph

79 Commits

Author SHA1 Message Date
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
Jussi Pakkanen cf6693a4eb Linker flag for Windows GUI applications was missing on MSVC. 2017-09-26 21:46:32 +03:00
Jussi Pakkanen bea6b1a6f6 Merge pull request #2187 from centricular/fix-pcap-dependency
Fix pcap dependency, str.strip() now takes an argument, add cc.get_return_value()
2017-09-22 22:04:18 +03:00
Luke Shumaker bb25260f00 flake8: Perform suggested whitespace/formatting changes
This only touches newlines, spaces, and (occaisionally) commas.  Anything
else is left for another commit.
2017-09-21 11:59:03 -04:00
Nirbheek Chauhan 59473e9ed7 Add a new compiler method: get_return_value()
This method accepts a single function that takes no arguments and
returns a single value which can be a value that can be cast to
a 64-bit signed integer, or a string, and returns that value.

Mostly useful for running foolib_version() functions that return the
currently-available version of libraries.
2017-09-20 13:36:42 +05:30
Alexis Jeandet e553d0807b Last round with listify function refactoring.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-09-18 22:25:34 +02:00
Matthias Klumpp 6cd3f066b4 d: Implement specific properties for D features 2017-09-12 17:32:03 +02:00
Matthias Klumpp d83c289442 d: Add easy way to use D-specific features
Of course D compilers have different flags to set some important
D-specific settings. This adds a simple method to change these flags in
a compiler-agnostic way in Meson.

This replaces the previous `unittest_args` method with a more generic
variant.
2017-09-12 17:32:03 +02:00