Commit Graph

2932 Commits

Author SHA1 Message Date
Jussi Pakkanen 3d86a24b55 Remove unnecessary -lquadmath from FORTRAN flags. 2018-09-02 18:25:09 +03:00
Alexis Jeandet 73a5b4332d Meson should warn if b_lundef is mixed with any sanitizer with clang
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-09-02 18:21:44 +03:00
Mathieu Duponchelle b2f92ea689 gnome: fix generate_gir when linking with libasan
The regression was introduced in my recent refactoring of
that method (8377ea4).

This commit simply restores the ordering of the generated
scan_command, ensuring `-lasan` and other internal linker
flags come before `--library` or `--program`
2018-08-31 08:09:28 -07:00
Nirbheek Chauhan bead8287a5 Improve support for macOS dylib versioning
We now use the soversion to set compatibility_version and
current_version by default. This is the only sane thing we can do by
default because of the restrictions on the values that can be used for
compatibility and current version.

Users can override this value with the `darwin_versions:` kwarg, which
can be a single value or a two-element list of values. The first one
is the compatibility version and the second is the current version.

Fixes https://github.com/mesonbuild/meson/issues/3555
Fixes https://github.com/mesonbuild/meson/issues/1451
2018-08-29 15:51:23 -07:00
Jussi Pakkanen b86f2fd17f
Merge pull request #4016 from thiblahute/hotdoc
modules: Add an 'hotdoc' module
2018-08-29 21:18:26 +03:00
David Seifert 28c1f31d7e Make `-std=` fallback remapping more robust
* The current version matching logic is brittle
  with respect to Clang. LLVM and Apple Clang use
  slightly different but nowadays overlapping
  version ranges. Instead, we now just check whether
  the compiler supports the given `-std=` variant
  and try its respective fallback instead of
  testing version ranges.
2018-08-29 20:57:35 +03:00
David Seifert cc37a66077 Deduplicate build-tree RPATHs on macOS
* Currently, RPATHs coming from dependencies and
  `build_rpath` provided by the user might contain
  the same path. Apple's `install_name` tool is
  allergic to providing the same argument twice
  when removing RPATHs:

    error: install_name_tool: "-delete_rpath /usr/lib" specified more than once
2018-08-28 23:26:08 -07:00
Thibault Saunier 6f72473b24 docs: Use meson to build documentation
Let's eat our own dogfood.
2018-08-28 18:18:40 -03:00
Thibault Saunier 378bd4df0e modules: Add an 'hotdoc' module
hotdoc: http://github.com/hotdoc/hotdoc/
2018-08-28 18:18:40 -03:00
Nirbheek Chauhan 8dd2e42de3 CompilerArgs: -Wl,-lfoo is also a valid way to pass a library
Treat it the same as -lfoo by deduping and adding to --start/end-group

Reported at https://gitlab.gnome.org/GNOME/glib/issues/1496

We don't do any advanced transformation for MSVC or de-dup because
this is a very rare syntax.
2018-08-28 19:10:30 +03:00
FFY00 234bb45b02 d: fix how the DC variable is handled 2018-08-27 23:48:51 +03:00
Jussi Pakkanen fb770e1e3d Add support for custom dist scripts. 2018-08-27 23:35:29 +03:00
Jussi Pakkanen 1ffc8de5e8
Merge pull request #3981 from GoaLitiuM/d-win-fixes
Fix D support on Windows
2018-08-27 22:30:23 +03:00
Thibault Saunier 731906504e Add a `required` argument to `subproject`
Allowing to use the new "feature" option type and allowing not to fail
on subproject if it is not necessary to fail.

By default subprojects are "required" so previous behaviour is not
changed.

Fixes #3880
2018-08-27 21:37:18 +03:00
Jussi Pakkanen 899b0aae9f
Merge pull request #4035 from jon-turney/factor-out-version-check
Apply dependency(version:) check for all dependency types
2018-08-27 21:29:57 +03:00
FFY00 ac07ae7d41 d: disallow dmd frontends (ldmd and gdc) 2018-08-27 00:57:35 +03:00
Jon Turney e0e980e064 Remove some spurious calls to the format() function
Remove some spurious calls to the format() function, left by mistake after
c2f37853
2018-08-27 00:56:14 +03:00
Andrei Antonov 8f7781f1d6 using urlopen() with explicit timeout 2018-08-27 00:55:45 +03:00
Jon Turney 0f568cc8d5
Don't use version to check for a not-found fallback
In _find_cached_fallback_dep(), actually check if dependency is not found,
rather than using a specific version as a proxy for that.
2018-08-26 17:23:39 +01:00
Jon Turney 6a4c2d63d7
Comparison with an unknown dependency version should always fail
Consistently use None to store an unknown dependency version (rather than
'none', 'unknown' or some made up version)
2018-08-26 17:23:39 +01:00
Jon Turney 1ffb44fa01
Apply dependency(version:) check for all dependency types
At the moment, this check only exists for pkg-config dependencies (and dub,
where the code is cut-and-pasted)

Factor it out and apply it to all dependency type
2018-08-26 17:23:39 +01:00
Jon Turney b8de56ee61
Only use the numeric part of the pcap_lib_version()
Trim 'libpcap version ' and ' -- Apple version'

Future work: Note that method of finding the pcap version can't work when
cross-compiling.
2018-08-26 17:23:39 +01:00
Jon Turney a956698c79
Pass kwargs to ThreadDependency superclass constructor 2018-08-26 17:23:39 +01:00
Jon Turney 15d902cdb0
Drop redundant logging in OpenMPDependency constructor
This should have been removed in f2673d9b
2018-08-26 17:23:39 +01:00
Jon Turney 921977589a
Set is_found in AppleFrameworks constructor
Set is_found in AppleFrameworks constructor, rather than overriding the
found() method, as other superclass methods may access is_found.
2018-08-26 17:23:39 +01:00
Jon Turney e75b7cdc15
Fix a misplaced bracket in GLDependency constructor
This is a typo in 82bdf07a
2018-08-26 17:23:39 +01:00
Jussi Pakkanen f34f0717e0 Revert symlink copy behaviour. Closes #4069. 2018-08-23 21:53:38 -07:00
Jussi Pakkanen 23e6200c14 My bad. 2018-08-23 21:16:28 -07:00
Nirbheek Chauhan 79aec5f342 CompilerArgs: Allow calling to_native() multiple times
Add a keyword argument to to_native() to operate on a copy so that we
can call it multiple times instead of modifying the original compiler
args while iterating.

This is used in the unit test, and might be used in Meson at some
point too.
2018-08-23 19:16:02 -07:00
Ole André Vadla Ravnås a7e6c1aaa4 compilers: Handle dupes in the --start/end-group logic
The index calculated through `self.index()` may find the same flag
earlier in the list and end up putting `--end-group` in the wrong spot.
2018-08-23 19:16:02 -07:00
Xavier Claessens a94099bc65
Merge pull request #4068 from ndufresne/master
help: Fix printing list of wrap mode
2018-08-23 09:12:51 -04:00
Xavier Claessens 3f3ae097d5
Merge pull request #3769 from xclaesse/command-line-step2
Command line step2
2018-08-23 09:12:27 -04:00
Jussi Pakkanen 54aed1a92c Added "native" kwarg to add_XXX_args. Closes #3669. 2018-08-22 23:22:48 +03:00
Ole André Vadla Ravnås 6cd71a8033 compilers: Reduce sizes of MSVC linked binaries
- For optimization=s add /O1: Use Maximum Optimization (Favor Size),
  and remove /Os as it's implied by /O1.
- Because we add /O1, this implies /Gy, i.e. Function-Level Linking, so
  unused code can be omitted.
- Add /Gw: Optimize Global Data, so unused data can be omitted.

With buildtype=minsize on x86 this reduces the size of a statically
linked Vala compiler binary from 5 MB down to just 1.87 MB.
2018-08-22 22:58:13 +03:00
Nirbheek Chauhan bb5f2ca3da find_library: Allow undefined symbols while linking
Shared libraries may not always be linkable without the use of other
libraries, so don't make it a linker error.
2018-08-22 12:24:43 -07:00
Bruce Richardson 8c9296e8e6 find_library: Use _build_wrapper to get library dirs
This means that we will take into account all the flags set in the
cross file when fetching the list of library dirs, which means we
won't incorrectly look for 64-bit libraries when building for 32-bit.

Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com>

Closes https://github.com/mesonbuild/meson/issues/3881
2018-08-22 12:24:43 -07:00
Xavier Claessens 05cab3dee5 Set wrap_mode to None by default to know if user passed a value 2018-08-22 15:15:54 -04:00
Xavier Claessens 55bbb3600f mesonmain: Use MesonException instead of RuntimeError in MesonApp init 2018-08-22 15:15:54 -04:00
Xavier Claessens bef8187e43 mlog.shutdown(): Return the log file path or None if not initialized 2018-08-22 15:15:54 -04:00
Xavier Claessens 1e6d72eb5a Remove useless __main__ in files that cannot be executed 2018-08-22 15:15:54 -04:00
Xavier Claessens fda99b08a4 interpreter: Simplify get_option_internal() and fix base option fallback
The fallback to compilers.base_options was done after optname is changed
to have subproject prefix. Simplify the code by looping over all
dictionaries and only keep user_options separate because that one is
special.
2018-08-22 15:15:54 -04:00
Nicolas Dufresne 3147b41787 help: Fix printing list of wrap mode
Implement a string converter in our WrapMode enum so that argparse will
only print the names in the doc instead of WrapMode.<name>.

This changes --help command from printing:
  --wrap-mode {WrapMode.default,WrapMode.nofallback,WrapMode.nodownload,WrapMode.forcefallback}
to:
  --wrap-mode {default,nofallback,nodownload,forcefallback}

Fixes issue #4067
2018-08-22 10:43:08 -04:00
Nirbheek Chauhan 05b54b4767 PkgConfigDependency: Parse library paths in a separate step
pkg-config and pkgconf treat additional search paths in
PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR differently when
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 is set.

pkg-config always outputs -L flags for the additional paths first, and
pkgconf always outputs -L flags for the default paths first.

To account for this inconsistency, we now sort the library paths into
two separate sets: system (default) and prefix (additional) paths. We
can do this because we always query pkg-config twice: once with
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 set and once without it.

Then, we ensure that the prefix paths are searched before the system
paths.

Closes https://github.com/mesonbuild/meson/issues/4023
Closes https://github.com/mesonbuild/meson/issues/3951
2018-08-21 13:22:29 -07:00
Xavier Claessens 79f8c76326
Merge pull request #4064 from xclaesse/allow-dups
UserArrayOption: Allow duplicates when used as <lang>_args option
2018-08-21 08:59:55 -04:00
Jussi Pakkanen 19617f8661
Merge pull request #4036 from jon-turney/fix_issue_3999
Fix compiling multiple Windows resources using pathnames with non-unique basenames
2018-08-21 00:56:10 +03:00
Xavier Claessens 576f3bb1bf UserArrayOption: Allow duplicates when used as <lang>_args option
Closes: #4021.
2018-08-20 16:16:38 -04:00
GoaLitiuM fd2c3b4c77 Handle proper linking of MSVC runtime libraries
DMD expects mscrtlib arguments while compiling, whereas LDC2 expects these while linking.
2018-08-20 22:27:31 +03:00
GoaLitiuM b208cbda81 Remove optimization related arguments from buildtype args, inline release builds
Dub enables inlining by default for release builds, so meson should do it as well.
2018-08-20 22:27:31 +03:00
GoaLitiuM 9d5448ab45 Normalize string constructs of d_import_dirs paths
Fixes skipped deprecation warnings of badly constructed d_import_dirs on Windows.
2018-08-20 22:27:31 +03:00
GoaLitiuM 4a1d64cb6c Fix import libraries and static library naming 2018-08-20 22:27:31 +03:00