Commit Graph

8563 Commits

Author SHA1 Message Date
8d576eba91 Prepare new release. 0.53.0 2020-01-07 22:12:25 +02:00
a1d2444e4a One more symlink test skip. 2020-01-07 22:12:09 +02:00
a8caf988c6 environment: Fix detection of icc on macOS
Which wouldn't call the function to detect c_args and friends.
2020-01-07 00:51:29 +02:00
7ec3af95e5 Updated linker MR (#6407)
* environment: Fix passing always args to a number of less common linkers

These are mostly (oops xilink) proprietary linkers I can't use for
various reasons.

Fixes: #6332

* Add intelfix from scivision.

* Ifort fix from scivision.

* PGI fix from scivision.

* Cuda fix from scivision.

* Fix linker passing for armclang.
2020-01-06 16:49:34 +02:00
6e7d5a0c61 Make D template work even if dub is not available. 2019-12-31 13:19:21 +02:00
e9158b477f Only run symlink test from git checkout. 2019-12-29 20:45:06 -05:00
4f6453bc32 cmake: Use trace for missing link flags (fixes #6386)
This is neccessary for static libraries, since the
CMake file API does not add link flags here.
2019-12-29 19:02:24 +02:00
d67423ab11 bugfix: netcdf pkgconfig stop if found 2019-12-28 19:46:30 +02:00
8dd4e63eb3 Merge pull request #6380 from scivision/cuda_qc
refactor/doc: cuda tests
2019-12-28 19:45:29 +02:00
e1dd310333 bugfix: check len before index 2019-12-24 09:25:53 -05:00
9aa766da64 refactor: cuda no unused args 2019-12-23 17:25:35 -05:00
a910ba133a doc: cuda windows comment 2019-12-23 17:25:14 -05:00
9e341ce81c doc: examples of run_project_tests.py options 2019-12-23 17:24:34 -05:00
77e0008a1f cmake: Fix obeject libraries
This fixes an issue with generated sources and object libraries, as
well as an issue on windows with the `link` linker and the vs backend.
The last issue is resolved by building the source files multiple times
to avoid extracting object files in meson.
2019-12-22 22:38:20 +02:00
7981308e6e Merge pull request #6355 from scivision/depmethod
dependencies: refactor {coarray,mpi,hdf5,netcdf} to use dependency(.., methods: ...)
2019-12-21 23:25:10 +02:00
e5297aeca5 summary: Change 'section' to be a kwarg instead of positional
Fixes: #6372.
2019-12-19 14:19:39 -05:00
5695dc0f16 add compiler.get_linker_id() method
this can be useful for if/elif where linker behaviors must be
considered.

For example, clang with "link" vs gcc with "ld.bfd" etc.

ci for compiler.get_linker_id() method

doc

add @FeatureNew check

Co-Authored-By: Daniel Mensinger <daniel@mensinger-ka.de>
2019-12-19 12:03:55 -05:00
ccbb20e881 ci: improve robustness
* netcf
* hdf5
* scalapack
* coarray
2019-12-19 11:59:47 -05:00
f1d370247f dependencies: refactor to use methods properly 2019-12-19 11:52:32 -05:00
06821755d2 CI: Skip NetCDF Fortran test on OSX 2019-12-19 11:13:30 -05:00
ca34d01dcc CI: Skip git tests if g-ir-scanner does not exist 2019-12-19 11:13:30 -05:00
792a84199b CI: Fix C++11 related error on osx for protocol buffer 2019-12-19 11:13:30 -05:00
fb121f6254 fs: rename samefile => is_samepath
is_samepath better reflects the nature of this function--that files
and directories can be compared.

Also, instead of raising exceptions, simply return False when one
or both .is_samepath(path1, path1) don't exist. This is more
intuitive behavior and avoids having an extra if fs.exist() to go
with every fs.is_samepath()
2019-12-19 08:51:31 -05:00
9e21942780 linkers: Remove get_allow_undefined_args from link.exe
PE DLLs don't work like elf or mach-o, there's no way to define symbols
at run time, they must all be defined as import or export at link time.
As such there's no value in being able to have undefined symbols in
MSVC, nor does meson expose an option to change them

Fixes: #6342
2019-12-18 21:57:03 +02:00
04e08f5a1f PkgConfigDependency: Sort -L flags according to PKG_CONFIG_PATH
When there is more than one path in PKG_CONFIG_PATH. It is almost always
preferred to find things in the order specified by PKG_CONFIG_PATH
instead of assuming pkg-config returns flags in a meaningful order.

For example:

/usr/local/lib/libgtk-3.so.0
/usr/local/lib/pkgconfig/gtk+-3.0.pc
/usr/local/lib/libcanberra-gtk3.so
/usr/local/lib/pkgconfig/libcanberra-gtk3.pc
/home/mesonuser/.local/lib/libgtk-3.so.0
/home/mesonuser/.local/lib/pkgconfig/gtk+-3.0.pc

PKG_CONFIG_PATH="/home/mesonuser/.local/lib/pkgconfig:/usr/local/lib/pkgconfig"

libcanberra-gtk3 is a library which depends on gtk+-3.0. The dependency
is mentioned in the .pc file with 'Requires', so flags from gtk+-3.0 are
used in both dynamic and static linking.

Assume the user wants to compile an application which needs both
libcanberra-gtk3 and gtk+-3.0. The application depends on features added
in the latest version of gtk+-3.0, which can be found in the home
directory of the user but not in /usr/local. When meson asks pkg-config
for linker flags of libcanberra-gtk3, pkg-config picks
/usr/local/lib/pkgconfig/libcanberra-gtk3.pc and
/home/mesonuser/.local/lib/pkgconfig/gtk+-3.0.pc. Since these two
libraries come from different prefixes, there will be two -L arguments
in the output of pkg-config. If -L/usr/local/lib is put before
-L/home/mesonuser/.local/lib, meson will find both libraries in
/usr/local/lib instead of picking libgtk-3.so.0 from the home directory.

This can result in linking failure such as undefined references error
when meson decides to put linker arguments of libcanberra-gtk3 before
linker arguments of gtk+-3.0. When both /usr/local/lib/libgtk-3.so.0 and
/home/mesonuser/.local/lib/libgtk-3.so.0 are present on the command
line, the linker chooses the first one and ignores the second one. If
the application needs new symbols that are only available in the second
one, the linker will throw an error because of missing symbols.

To resolve the issue, we should reorder -L flags according to
PKG_CONFIG_PATH ourselves before using it to find the full path of
library files. This makes sure that we always follow the preferences of
users, without depending on the unreliable part of pkg-config output.

Fixes https://github.com/mesonbuild/meson/issues/4271.
2019-12-18 11:34:24 -05:00
c4649704c8 python: add embed to the python dependency function 2019-12-18 01:19:16 +02:00
3122bac28a Merge pull request #4649 from dcbaker/summary-function
Add a summary() function for configuration summarization
2019-12-18 01:17:27 +02:00
a2a9611e1d Merge pull request #6065 from dcbaker/pass-options-to-linker-detection
Pass options to linker detection
2019-12-17 21:09:26 +02:00
8a57b608ad ci cmake: Windows link.exe skip due to symbol issues 2019-12-17 16:59:27 +02:00
39db7b1afc Fail gracefully detecting hdf5 if pkg-config is not available. 2019-12-17 15:10:13 +02:00
58999cad91 Fix macOS library test when using system zlib. 2019-12-17 15:10:13 +02:00
585ccfc789 Clean MSI generator Try 2 [skip ci] 2019-12-16 18:33:54 +02:00
eb67fb1d97 default inc dirs: Fix warning on MSYS (fixes #6336) 2019-12-15 13:25:16 +02:00
d8921f15a3 ci: type hint checking for compilers/mixins/intel.py 2019-12-14 23:35:07 +02:00
0b7fe3f78a intel/intel-cl: handle arguments in intel-specific way
intel compiler's defaults are different enough from MSVC and GNU
that it's necessary to set specific defaults for Intel compilers.

This corrects/improves behaviors initially addressed in  b1c8f765fa
2019-12-14 23:35:07 +02:00
31bb6eae45 run_tests.py: use mlog.log_once to avoid spamming ninja < 1.9 warnings 2019-12-13 09:57:05 -05:00
7f0224fb88 compilers: make use of mlog.log_once
I'm sure there are other places that could use this, but I didn't see
any right off that bat.
2019-12-13 09:57:05 -05:00
614372aa55 mlog: Add a log_once function
There are a number of cases where we end up spamming users with the same
message over and over again, which is really annoying. This solves that.
2019-12-13 09:57:05 -05:00
eb30c493f6 mlog: remove incorrect uses of global keyword
global is only needed to allow replacement of global values, they're
always in scope to read.
2019-12-13 09:57:05 -05:00
a4bb0928e3 summary: Add 'Subprojects' section to main project 2019-12-12 18:30:17 -05:00
38953d8ee3 summary: Add bool_yn keyword argument 2019-12-12 18:30:17 -05:00
49082f9669 summary: Allow section with no title, and passing key/value separately 2019-12-12 18:30:17 -05:00
6e865a2330 Add a summary() function for configuration summarization
Based on patch from Dylan Baker.

Fixes #757
2019-12-12 18:30:17 -05:00
3778a34979 mintro: include test protocol in introspection data 2019-12-13 00:47:10 +02:00
9371965132 ci fortran: add case where buildtype=release and warning_level=3
this can find issues with non-default build options
2019-12-13 00:45:49 +02:00
47dfe34c85 Consider compiler arguments in linker detection logic
If a user passes -fuse-ld=gold to gcc or clang, they expect that they'll
get ld.gold, not whatever the default is. Meson currently doesn't do
that, because it doesn't pass these arguments to the linker detection
logic. This patch fixes that. Another case that this is needed is with
clang's --target option

This is a bad solution, honestly, and it would be better to use $LD or a
cross/native file but this is needed for backwards compatability.

Fixes #6057
2019-12-12 10:57:27 -08:00
87766b3727 Allow setting <lang>_args before the compiler is detected
This is required to be able to pass compiler and linker arguments to the
methods that try to guess what linker to use.
2019-12-12 10:52:07 -08:00
7460e4ccda compilers: Make get_display_language a class or static method
Currently this is done at the instance level, but we need it at the
class level to allow compiler "lang" args to be gotten early enough.
This patch also removes a couple of instance of branch/leaf classes
providing their own implementation that is identical to the Compiler
version.
2019-12-12 09:35:32 -08:00
ee6e249f65 compilers: move language attribute to the class level
We know that if a compiler class inherits CCompiler it's language will
be C, so doing this at the class level makes more sense.
2019-12-12 09:35:30 -08:00
0bf8862beb docs: Fix wrong example for shaderc dependency [skip ci]
The example is meant for wxWidgets not Shaderc.
2019-12-12 10:44:12 -05:00