Commit Graph

188 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 3a6920ebdc Add helper to print warnings once
The helper is general, although in this patch it is only used for
warnings. No functional change intended.
2019-09-25 14:52:07 +02:00
Aleksey Gurtovoy 6ac5db50c9 CUDA support on Windows 2019-09-24 14:22:20 -07:00
Alan Coopersmith 3e0279ba9f get_library_dirs: Add Solaris 64-bit library subdirs
Solaris puts 32-bit libraries in the main /lib & /usr/lib directories
and 64-bit libraries in platform specific subdirectories.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-09-13 16:13:44 -07:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Thibault Saunier 42c5e4fe2b wine: Try to get the short paths when generating WINEPATH
The size of WINEPATH is limited (1024 [until recently]), we
can very easily reach that limit, and even the new one (2048) so
try to keep path as small as possible by using the shortPath
version of paths.

Also assert that we do not reach the new hard limit.

And avoid having duplicates in the list of path.

[until recently]: https://bugs.winehq.org/show_bug.cgi?id=45810
2019-08-24 06:43:47 -04:00
nia 246b49fe75 Support NetBSD aarch64 and earm. 2019-08-23 13:10:25 -07:00
Jussi Pakkanen a201499306 Only iterate over existing libdirs. 2019-08-17 13:14:05 +03:00
Dylan Baker 753587ee15 mesonlib: Annotate Popen_safe functions
These are used in linkers.py and need to be annotated to make linkers.py
100% clean
2019-07-23 09:58:24 +00:00
Nirbheek Chauhan 9c2724bce5 Add optional progress bar when generating build.ninja 2019-07-20 17:02:15 +03:00
Michael Hirsch, Ph.D 8e0acae439
type hints @dcbaker 2019-07-08 22:28:24 -04:00
Michael Hirsch, Ph.D c756d06fbb
add clang c_std=c18 alias
fix unit test skips for clang c18

correct unittests clang minimum version

cleanup unittest clang skip c_std

finesse unittest vs. clang version
2019-07-08 22:27:35 -04:00
John Ericson 8a09434cd4 remove `for_XXX` functions from mesonlib
All uses now use `env.machines.YYY.is_XXX` instead.
2019-06-09 13:13:31 -04:00
John Ericson 32e827dcdc Use `env.machines.*` to avoid some `is_cross`
This is a small example of the `is_cross` removal the that abstraction
enables.
2019-06-09 13:13:20 -04:00
John Ericson af2d7af998 Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
2019-06-05 23:05:34 -04:00
Michael Hirsch, Ph.D e83084fbfe BUGFIX variable name #5285
handle x86 correctly
2019-05-28 21:55:54 +03:00
Jussi Pakkanen 67a5af99aa
Merge pull request #5395 from dcbaker/mtest-annotations
Mtest annotations and bug fixes
2019-05-16 00:31:01 +03:00
John Ericson 957d8e051c Make `PerMachine` and `MachineChoice` have just `build` and `host`
Meson itself *almost* only cares about the build and host platforms. The
exception is it takes a `target_machine` in the cross file and exposes
it to the user; but it doesn't do anything else with it. It's therefore
overkill to put target in `PerMachine` and `MachineChoice`. Instead, we
make a `PerThreeMachine` only for the machine infos.

Additionally fix a few other things that were bugging me in the process:

 - Get rid of `MachineInfos` class. Since `envconfig.py` was created, it
   has no methods that couldn't just got on `PerMachine`

 - Make `default_missing` and `miss_defaulting` work functionally. That
   means we can just locally bind rather than bind as class vars the
   "unfrozen" configuration. This helps prevent bugs where one forgets
   to freeze a configuration.
2019-05-16 00:27:57 +03:00
Dylan Baker 2cc70c631b mesonlib: Annotate substring_in_list
for mtest
2019-05-14 16:43:29 -07:00
Simon Ney 81170a9cbe This is the fork "sneyx1234/meson" of the current git "mesonbuild/meson" head to converge it to the solaris 11.4 platform based on the sparcv9 and i386 processor architecture.
The purpose is to complete the porting related to the fork "sneyx1234/ast" of "att/ast" the "AT&T kornshell".
2019-05-13 02:42:56 +03:00
Dylan Baker edb1229a48 mesonlib: Make a few type annotations strings
Mypy know what to do with these and isn't confused, but some versions of
python 3.5 (at least 3.5.2) can't handle these annotations. By making
them strings the python interpreter wont try to evaluate them.

Fixes #5326
2019-05-02 23:38:36 +03:00
Jussi Pakkanen 1f4023fa47
Merge pull request #5311 from mensinda/flake8Plugins
Added flake8 plugins and some code fixes
2019-05-02 23:30:29 +03:00
John Ericson 4c2617a9c6 Add some type annotations and fix lints
Some things, like `method[...](...)` or `x: ... = ...` python 3.5
doesn't support, so I made a comment instead with the intention that it
can someday be made into a real annotation.
2019-05-02 10:58:23 -07:00
Michael Olbrich a15a8b7e24 Don't close fds when executing programs
This is basically the same as #1612 just for new new Popen_safe_legacy().
2019-05-01 21:28:29 +03:00
Daniel Mensinger e75211d321
Fix builtin variable names 2019-04-29 12:17:40 +02:00
Jussi Pakkanen 60969d99d3
Merge pull request #5265 from dcbaker/more-annotations
Fully annotate the envconfig and mlog modules
2019-04-28 20:20:25 +03:00
Dylan Baker cbdf9d0647 mesonlib: Reimplement version comparison for speed 2019-04-25 12:28:51 -07:00
Dylan Baker c30ccae0b6 mesonlib: Remove useless repetition of the same check
due to refactoring this is now useless.
2019-04-25 12:28:51 -07:00
Dylan Baker fa26844f67 mesonlib: specialize the implementation of == and !=
Instead of using the ___cmp__ method just straight up compare the two
values, since we've already converted numbers to ints and split
non-numeric seperators this is sufficient, and 4x faster
2019-04-25 12:28:51 -07:00
Dylan Baker 8977e49a9b mesonlib: use ints instead of strings for numbers
makes version comparisons even faster
2019-04-25 12:28:51 -07:00
Dylan Baker 506f8708ba mesonlib: use zip() in Version
Instead of range. This makes version comparison 25-50% faster depending
on the operator and how different the values are.
2019-04-25 12:28:51 -07:00
Dylan Baker 25f8d28251 mesonlib: Add some type annotations
Just enough to make mlog and envconfig happy
2019-04-22 13:49:50 -07:00
Dylan Baker ac627bcea7 replace library type strings with an enum
This patch creates an enum for selecting libtype as static, shared,
prefer-static, or prefer-shared. This also renames 'static-shared'
with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is
just a refactor with no behavioral changes or user facing changes.
2019-03-20 18:45:56 +02:00
Niclas Zeising f85a71605d Fix get_library_dirs() on FreeBSD
Fix get_library_dirs() on FreeBSD to only return /usr/local/lib,
/usr/lib and /lib as the default location to look for libraries.
FreeBSD does not use lib/${platform} or lib64 by default.  In general,
those directories should not exist, but in case they do, ensure they're
not picked up.
2019-02-20 21:44:40 +02:00
Niclas Zeising 87d64b4632 Fix default_libdir() on FreeBSD
Fix defaul_libdir() on FreeBSD.  The current behaviour of using
usr/lib64 if that exists is wrong on FreeBSD.  The default should be to
always use usr/lib, even if usr/lib64 exists as a folder in the file
system.  Fix this by checking if we're running on FreeBSD and then
always return 'lib' in default_libdir().
2019-02-20 21:44:40 +02:00
Michael Hirsch, Ph.D 907af96193 add type hinting
more type hints

syntax modernization / robustify

syntax typo

more effective directory collection
2019-02-13 21:04:39 +02:00
Dylan Baker 0eccce799f mesonlib: Use class syntax for defining MachineChoice
Mypy struggles with the imperative form of Enum declaration, and
upstream doesn't consider it a bug, they recomend using the class form
for enums that are going to be externally exposed.
2019-02-11 12:50:32 -08:00
Nirbheek Chauhan 79c087bad2 macos: lipo outputs aarch64 as arm64, fix it
Or we'll reject arm64 objects as invalid when building for aarch64
2019-02-01 10:28:37 +00:00
Nirbheek Chauhan b5f6be6733 macos: lipo from older xcode does not support -archs 2019-01-31 20:36:49 +00:00
Nirbheek Chauhan 50b863032e find_library: Check arch of libraries on Darwin
macOS provides the tool `lipo` to check the archs supported by an
object (executable, static library, dylib, etc). This is especially
useful for fat archives, but it also helps with thin archives.

Without this, the linker will fail to link to the library we mistakenly
'found' like so:

ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
2019-01-31 20:36:49 +00:00
Nirbheek Chauhan c0166355ce Rewrite appleframework and extraframework dependency classes
Instead of only doing a naive filesystem search, also run the linker
so that it can tell us whether the -F path specified actually contains
the framework we're looking for.

Unfortunately, `extraframework` searching is still not 100% correct in
the case when since we want to search in either /Library/Frameworks or
in /System/Library/Frameworks but not in both. The -Z flag disables
searching in those prefixes and would in theory allow this, but then
you cannot force the linker to look in those by manually adding -F
args, so that doesn't work.
2019-02-01 00:14:09 +05:30
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
Christoph Reiter 8df5afc98a configure_file: preserve newlines of the input file. Fixes #4817
In some cases (see #4817) it's helpful if the output file uses the
same newlines as the input file without translating them to the
platform defaults.

open() by default recognizes all newline styles and translates them
to "\n" and then to the platform default when writing.
Passing "" to "newline" disables the translation and lets us pass through
the original newline characters.
2019-01-24 21:02:34 +02:00
Dylan Baker f9a35e08ac msetup: Fix callig meson --wipe inside a build directory
This seems to be related to deleting the current working directory.
Simply deleting all of the trees inside the build directory instead
seems to fix it. This only appears with some combination of generated
targets, running the test case against say "1 trivial" doesn't show the
bug.

See this mesa bug: https://bugs.freedesktop.org/show_bug.cgi?id=109071
2018-12-20 13:30:30 -05:00
Marcel Hollerbach 388108aa88 meson: performance optimizethe file object
reduce the amount of access calls to the os.
This safes ~1 sec. build time
2018-11-02 21:04:13 +02:00
John Ericson 807981889f Fix bug in PerMachine constructor
Don't make single element tuple
2018-10-28 00:05:27 +01:00
Jussi Pakkanen 6f6afe24a7
Merge pull request #4326 from Ericson2314/per-machine
Start leveraging MachineInfo with for_* methods
2018-10-25 19:48:42 +03:00
Jon Turney a0a0c244e2 os.path.relpath() can fail on Windows
If builddir and sourcedir have different drive letters, a relative path
doesn't exist, and os.path.relpath fails with a ValueError exception.

This just fixes the places which are hit by test cases in a simple-minded
way.  There are several other uses of os.path.relpath(), which might be
suspect.
2018-10-10 19:43:24 +03:00
John Ericson 68d0adf4d2 Rewrite `for_*` machine checks in terms of MachineInfo and phase out
It's much better to directly query the machine in question rather than
do some roundabout "is_cross" thing. This is the first step for much
natve- and cross- code path deduplication.
2018-10-05 23:31:16 -04:00
John Ericson d69d2697cd Pull out essence total map essence of MachineInfos into PerMachine
We'll eventually have many other data structure duplicated for each
build, host, and target machines. This sets up the infrastructure for
that.
2018-10-05 23:31:15 -04:00
Xavier Claessens 246d5d86f5 Move set_meson_command() to mesonlib 2018-10-04 09:39:26 -04:00