Commit Graph

1983 Commits

Author SHA1 Message Date
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
Jussi Pakkanen bc83c58d37
Merge pull request #2731 from mesonbuild/disabler
Created disabler object type
2017-12-05 01:10:50 +02:00
Jon Turney 87e6201214 Document and improve not-found dependency objects
Document dependency('', required:false) usage.
Avoid emitting 'Dependency  found: NO'.
2017-12-05 01:04:57 +02:00
Jussi Pakkanen 678daad6cc Created a new disabler type. 2017-12-04 23:53:23 +02:00
Joergen Ibsen 521933357d Fix path for str arguments to depend_files
Fixes #2633
2017-12-03 23:24:30 +02:00
Niklas Claesson 9884508535 Boost: Pick correct version
If many binary packages are installed, pick the one built with the correct
toolset. Fixes #2532
2017-12-03 23:21:33 +02:00
Jussi Pakkanen 112e6c1927
Merge pull request #2638 from jibsen/use-value-regex
Use regex to substitute template strings
2017-12-03 23:03:13 +02:00
Jussi Pakkanen 018deb48fe
Merge pull request #2663 from inigomartinez/pkg-config-define-variable
dependencies: Allow pkg-config to define variables
2017-12-03 22:53:44 +02:00
Joergen Ibsen 312bc2ca81 Fix string format recursive replace
Also error on placeholder index out of range.
2017-12-03 22:51:58 +02:00
Jussi Pakkanen cf76ffad14
Merge pull request #2703 from mesonbuild/msvc-library-search-fixes
Various MSVC library search fixes
2017-12-03 22:48:56 +02:00
Jussi Pakkanen 2cf1e8da15 Merged array option branch. 2017-12-03 22:35:44 +02:00
Jussi Pakkanen f8a419b27d String arguments can permit arbitrary string values
by leaving out the choices keyword.
2017-12-03 22:27:55 +02:00
Nirbheek Chauhan 3851867a06 dependencies: Always convert MinGW paths to MSVC on Windows
The MinGW toolchain can read MinGW paths, but Python cannot and we
sometimes need to parse the libs and cflags manually (for static-only
library searching, for instance). The MinGW toolchain can always read
Windows paths with `/` as path separater, so just use that.
2017-12-03 10:06:11 +05:30
Nirbheek Chauhan 387b5e67a0 linkers: Return a Copy of VisualStudioLinker always_args
Otherwise people will accidentally append to it.
2017-12-03 10:06:11 +05:30
Nirbheek Chauhan 61d1e9596a dependencies: Also convert MinGW compile args
For the same reason as the library paths.
2017-12-03 10:06:11 +05:30
Nirbheek Chauhan 133df3b045 dependencies: Pass language to PkgConfigDependency
Also try harder to find a compiler that dependencies can use.

This means that in C++-only projects we will use the C++ compiler for
compiler checks, which can be important.
2017-12-03 10:06:11 +05:30
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
Nirbheek Chauhan 390f0b8b52 dependencies: Convert /c/foo/bar paths to C:/foo/bar
MSVC cannot handle MinGW-esque /c/foo paths, convert them to C:/foo.
We cannot resolve other paths starting with / like /home/foo so leave
them as-is so the user gets an error/warning from the compiler/linker.

These paths are commonly found in pkg-config files generated using
Autotools inside MinGW/MSYS and MinGW/MSYS2 environments.

Currently this is only done for PkgConfigDependency.
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
Jussi Pakkanen 793fc002fa
Merge pull request #2390 from dcbaker/submit/options-list
Add an array type to user options
2017-12-02 19:54:27 +02:00
Iñigo Martínez 44dd429ee5 dependencies: Fix pkg-config variable definition
In a previous commit variable definition was added in pkg-config.
However, this commit was not complete.

This fixes the missing parts of that commit.
2017-12-01 13:49:01 +01:00
Nirbheek Chauhan e1bdc098ca gnome.compile_resources: Prefer generated files over source files
We should always prefer generated files over onces in the source tree
else if the same file also exists in the source tree we get strange
behaviour where we ignore dependencies and the project has to be
built twice to be fully up-to-date.

See: https://bugzilla.gnome.org/show_bug.cgi?id=787677

Closes https://github.com/mesonbuild/meson/issues/2686
2017-11-30 23:15:19 +02:00
Niklas Claesson e0274441fc VS: Add /DEBUG to linker to generate debug information 2017-11-30 22:36:28 +02:00
Dylan Baker 6f25e93b52 cross: Implement support for loading cross files from system paths
One thing that makes cross compiling with meson a pain is the need for
cross files. The problem is not with cross files themselves (they're
actually rather brilliant in that they allow for a much greater deal of
flexibility than autotools hardcoded paths approach) but that each user
needs to reimplement them themselves, when for most people what they
really want is a cross file that could be provided by their distro, all
they really want is the correct toolchain.

This patch is the first stop to making it easier for distros to ship
their own cross files (and for users to put their's somewhere safe so
they don't get `git clean`ed. It allows the cross files (on Linux and
*BSD) to be stored in home and system paths (~/.config/meson/cross,
/usr/share/meson/cross, and /usr/local/share/meson/cross), and to be
loaded by simply by specificying --cross-file.

With this patch meson will check the locations its always checked first,
(is cross file absolute, or is it relative to $PWD), then will check
~/.config/meson/cross, /usr/local/share/meson/cross,
/usr/share/meson/cross, (or $XDG_CONFIG_PATH and $XDG_DATA_DIRS) for the
files, raising an exception if it cannot find the specified cross file.

Fixes #2283
2017-11-30 22:34:27 +02:00
Jussi Pakkanen ecba22965d
Merge pull request #2708 from mesonbuild/nirbheek/windows-shebang-parsing
dependencies: Fix parsing of shebangs with spaces
2017-11-30 22:21:24 +02:00
Dylan Baker d573a29bda mtest: Chdir into the build directory before running tests with -C
When `ninja -C builddir/ test` is run, ninja will change into the build
dir before starting, but `meson test -C builddir/` does not. This is
important because meson does not use (for good reasons) absolute paths,
which means if a test case needs to be passed as an argument a file name
that is part of the build process, it will be relative builddir. Without
changing into the builddir the path will not exist (or worse, point at
the wrong thing), and test will not behave as intended.

To fix this mtest will change directory before starting tests, and will
change back after all tests have been finished.

Fixes #2710
2017-11-30 22:19:54 +02:00
Jussi Pakkanen cabbb30ab4
Merge pull request #2668 from dcbaker/wip/macos-10.13-fixes
macos 10.13 fixes
2017-11-30 22:18:25 +02:00
Dylan Baker c9351ce30c Add new array type option
This exposes the already existing UserStringArrayOption class through
the meson_options.txt. The intention is to provide a way for projects to
take list/array type arguments and validate that all of the elements in
that array are valid without using complex looping constructrs.
2017-11-29 14:14:41 -08:00
Joergen Ibsen 1db319737d Enable ANSI colors on Windows when ANSICON is set
This enables colors with ConEmu.
2017-11-29 23:53:58 +02:00
Jussi Pakkanen 5208e6524c
Merge pull request #2701 from dcbaker/submit/better-llvm-docs
Minor LLVM dependency cleanups for the next release
2017-11-29 22:00:49 +02:00
Solomon Choina 2fdfb50da8 adding C++98 to versions that meson can support 2017-11-29 21:27:00 +02:00
Patrick Griffis 643d3a4976 gnome.gtkdoc: Fix missing permitted kwargs
Found by https://bugzilla.gnome.org/show_bug.cgi?id=790998
2017-11-29 12:36:11 -05:00
Nirbheek Chauhan abcace7ee1 dependencies: Fix parsing of shebangs with spaces
While finding an external program, we should only split the shebang
once since that is what Linux and BSD also do. This is also why
everyone uses #!/usr/bin/env in their shebangs since that allows
you to run an interpreter in a path with spaces in it.

See `man execve` for more details, specifically the sections for
interpreter scripts.
2017-11-29 21:30:57 +05:30
Dylan Baker f260a42216 Don't warn for optional_modules
LLVM can have optional modules, modules that will make the code faster
but are not required.
2017-11-28 17:12:45 -08:00
Alexis Jeandet 120f7a4c40 [Qt module] Added workaround for qt tools version detection
Depending on the tool (moc, uic, rcc, lrelease), the Qt version
(4.8, 5.7, 5.9) and the distribution (Fedora, debian,...) it seems you
cannot predict which of -v or -version will be supported.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-11-28 22:50:31 +02:00
Jussi Pakkanen 746e70c0da
Merge pull request #2512 from dcbaker/wip/config-tool-variables
Add method to get values from config tool based dependency
2017-11-28 22:01:00 +02:00
Dylan Baker 8a1a866c68 Don't print traceback when options are invalid
Currently passing a bad combo or array option, providing a non-boolean
to a bool arg, or a host of other things can cause an traceback from a
MesonException, don't do that.

Fixes #2683
2017-11-28 21:41:06 +02:00
Jussi Pakkanen 5bc1009109 Add if_found kwarg to subdir(). 2017-11-27 23:22:47 +02:00
Joergen Ibsen b9a0589067 Fix escaping of newlines in string literals
Replace '\n' escape sequence before '\\' to allow a literal backslash
to be inserted before the character 'n'.

Fixes #2682
2017-11-27 21:23:32 +02:00
Eric Engestrom da2343fb5e mconf: print choices of base options
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-11-27 20:54:03 +02:00
Nirbheek Chauhan 91d8784a04 configure_file: Compare difference in binary mode
Otherwise Python will try to use string decode on the configured file
and fail if it contains characters that can't be mapped to the current
encoding.
2017-11-27 20:53:27 +02:00
Jussi Pakkanen 11f1fc913d
Merge pull request #2690 from jsoref/spelling
Spelling
2017-11-27 01:36:43 +02:00
Jussi Pakkanen 4ca1e8638c Fix running tests when there is a period in PATH. 2017-11-27 01:35:27 +02:00
Josh Soref 4a572434a0 spelling: when 2017-11-26 17:28:33 +00:00
Josh Soref eb2a148218 spelling: verifier 2017-11-26 17:28:09 +00: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
Iñigo Martínez 3d0a9b7911 interpreter: Reduce to_sring method to base 10
The int's to_string method implementation has been reduced to base
10.
2017-11-26 17:14:32 +02:00