Commit Graph

119 Commits

Author SHA1 Message Date
Nirbheek Chauhan 1459d18643 dependency: Better errors when fallbacks are not found
Otherwise the message is very cryptic and no one can figure out what Meson
actually wants
2016-07-28 21:45:47 +05:30
Nirbheek Chauhan 88aafd363e Normalize the path of a configured file to avoid dupes (#640) 2016-07-19 20:10:57 +03:00
Nirbheek Chauhan 7217620e23 interpretor: Use the stdout/stderr locale to decode to string (#638)
Fixes a decode error with locales other than en_US on Windows
2016-07-15 20:37:21 +03:00
Jussi Pakkanen c0057da133 Can get arbitrary data from cross file properties. 2016-07-02 00:00:03 +03:00
Jussi Pakkanen 0733c0f9a1 Changed run_target to take command as kwarg and add depends. This makes it behave the same as custom_target. 2016-06-24 23:07:57 +03:00
Jussi Pakkanen ea4fe8e417 Run_target can run binaries obtained with find_program. 2016-06-24 15:02:43 +03:00
Nirbheek Chauhan fe52feb47d dependency: Fix version check for a not-found dependency
The check was wrong, and we were passing 'none' as the 'found' version
to the version compare if the cached dep was a not-found dependency
2016-06-21 08:40:48 +05:30
Nirbheek Chauhan 9e5a2c5e26 Use add_target() for adding targets returned from module functions
Without this, the target isn't added to self.coredata.target_guids and
the VS backends fail to parse the list of targets
2016-06-17 16:46:57 +05:30
Nirbheek Chauhan abf81aab77 Use cross-info c_args, c_link_args, etc for all compiler checks
This allows the user to specify custom arguments to the compiler to be used
while performing cross-compiler checks. For example, passing a GCC specs file as
c_link_args so that a "prefix" filled with libraries that are to be compiled
against can be found with cc.find_library, or an `-mcpu` c_arg that is required
for compilation.

Also ensure that unix_link_flags_to_native() and unix_compile_flags_to_native()
always return a copy of the original arguments and not a reference to the
original arguments. We never want to modify the original arguments.
2016-06-15 13:13:06 +05:30
Martin Hostettler 4979b4c84f compiler: Use cross tools args in sanity check. 2016-06-13 00:41:19 +02:00
Jussi Pakkanen beef7cb291 Added functionality to pick the first supported argument from a list. Closes #583. 2016-06-09 21:36:58 +03:00
Jussi Pakkanen d8d989d9b8 Add a has_arg method to compiler to check whether it supports a given argument. 2016-06-09 21:19:58 +03:00
Jussi Pakkanen bcec44b93b Merge pull request #573 from centricular/dependency-versions
Several fixes to how versioned dependencies are handled + tests
2016-06-05 13:51:03 +03:00
Jussi Pakkanen 177e286b3c Can generate config headers without an input file. Closes #549. 2016-06-01 20:25:14 +03:00
Jussi Pakkanen 144565fabf Added method to get current project name. 2016-05-30 20:29:35 +03:00
Nirbheek Chauhan 8c34ea645d interpreter: Compare the version of a cached dependency() before using it
Without this, checks with incompatible versions but the same library would
return true. Example:

dependency('zlib', version : '>=1.2')
dependency('zlib', version : '<1.0') # this will return the same dep again!

Example: https://github.com/mesonbuild/meson/issues/568
2016-05-30 03:40:30 +05:30
Nirbheek Chauhan 0096c51035 interpretor: Correctly check the version of a fallback dependency
Previously the check was always done with the project version--which is wrong.
It should always check against the version of the dependency requested.
2016-05-30 03:40:18 +05:30
Nirbheek Chauhan acdd4bd523 interpreter: Set declare_dependency version from the project version if missing
This simply sets the default version to be the same as the project version.
Useful for dependency version checks when using fallback subproject internal
dependencies.
2016-05-30 03:40:08 +05:30
Nirbheek Chauhan c33e7a68a1 Also reuse subproject-based fallback dependencies
This allows a project to use the same fallbacks dependency from the same
subproject multiple times in the same way that external dependencies can be.

Also change the format of the dependency identifier to ensure that fallback
checks with different dirname/varname aren't mistakenly reused. We now use
a tuple for this because the format is simpler to construct and it gives us the
same immutability guarantees as a string which is needed for using it as
a dictionary key.
2016-05-30 03:35:02 +05:30
Nirbheek Chauhan f2256ba098 interpreter: Check if subproject version is defined before comparing
Without this Meson gives a cryptic error emitted from inside
mesonlib.version_compare()
2016-05-30 03:35:02 +05:30
Jussi Pakkanen 0b81f5b0ad Merge pull request #569 from mesonbuild/cargs
Renamed compile&link args and made them accessible from get_option.
2016-05-29 23:46:14 +03:00
Nirbheek Chauhan 065dcee7f3 interpreter: Switch to prev_subdir on non-existant subdir (#571) 2016-05-29 13:24:51 +03:00
Jussi Pakkanen cff4e7d299 Can query version strings of dependencies. 2016-05-29 03:15:16 +03:00
Jussi Pakkanen b5013a573a Added semantic versioning comparison method to strings. 2016-05-29 02:59:24 +03:00
Jussi Pakkanen 28b555d2c8 Whitespace fix to test new Docker setup. 2016-05-28 22:17:57 +03:00
Jussi Pakkanen 7694321276 Renamed compile&link args and made them accessible from get_option. 2016-05-28 21:56:41 +03:00
Jussi Pakkanen 4377f773e0 Can set global linker arguments. Closes #536. 2016-05-28 21:31:59 +03:00
Jussi Pakkanen ac152a2282 Every target must have a non-empty name. 2016-05-28 13:59:39 +03:00
Jussi Pakkanen c320b08ffb Merge gettextarg branch. 2016-05-26 21:58:34 +03:00
Jussi Pakkanen 3b3c05f6b1 Can pass extra args to xgettext. Closes #554. 2016-05-26 01:09:37 +03:00
Jussi Pakkanen df03f849a8 Merge pull request #542 from mesonbuild/ownstdlib
Build transparently with a custom standard library
2016-05-25 23:44:24 +03:00
Jussi Pakkanen df90b26533 Merge pull request #548 from centricular/fix_has_exe_wrap
interpreter: Fix typo in has_exe_wrapper
2016-05-25 23:41:38 +03:00
Jussi Pakkanen babdb27570 Merge pull request #479 from mesonbuild/i18n
Moved gettext into i18n module.
2016-05-25 17:53:35 +03:00
Jussi Pakkanen 2a3a1ce8e0 Join() convenience method for strings. Closes #552. 2016-05-24 23:06:20 +03:00
Nirbheek Chauhan 7aad3ff658 interpretor: Fix typo in has_exe_wrapper
The function wasn't working at all because of this
2016-05-24 14:31:39 +05:30
Jussi Pakkanen afe7252476 Can specify a stdlib subproject that is used implicitly on all targets with said language. 2016-05-21 21:46:03 +03:00
Jussi Pakkanen dc148e0702 Remove all special casing for gettext and use elementary operations instead. 2016-05-21 18:21:23 +03:00
Hemmo Nieminen 7da51f3756 Do not append a period to test suite names. 2016-05-10 20:58:39 +03:00
Nirbheek Chauhan 2bdaa1f0c1 Separate out cpu_method to environment.py and add amd64 quirk 2016-04-15 00:25:35 +05:30
Nirbheek Chauhan c0765b0e8d Don't require an exe_wrapper when cross-compiling 32-bit on 64-bit
Almost all 64-bit x86 OSes can run 32-bit x86 binaries natively. Detect
that case and don't require an exe wrapper.
2016-04-15 00:25:34 +05:30
Nirbheek Chauhan 700010e452 New API: cc.has_header_symbol to check if a header defines a specific symbol
Also supports a 'prefix' keyword argument for feature checks such as _GNU_SOURCE
or for headers that need to be included first
2016-04-07 20:53:12 +05:30
Jussi Pakkanen cab5ce4fc0 Merge pull request #438 from trhd/testing_options
New options for controlling test output.
2016-04-06 23:10:20 +03:00
Jussi Pakkanen 737fde65fa Bring back the old manual search to cc.find_library. 2016-04-04 22:18:14 +03:00
Hemmo Nieminen af6f4c9b9c coredata: Centralize builtin option descriptions and definitions. 2016-04-04 02:52:30 +03:00
Hemmo Nieminen 336904b553 Move MesonException from coredata to mesonlib. 2016-04-01 00:52:45 +03:00
Jussi Pakkanen 12a4e7d7e7 Moved gettext into i18n module. 2016-03-28 20:15:16 +03:00
Jussi Pakkanen d87eb7d290 Merge branch 'base_options'. 2016-03-20 22:04:24 +02:00
Jussi Pakkanen 8b619420f9 Open Meson and option files explicitly as utf-8. Closes #467. 2016-03-20 21:21:23 +02:00
Jussi Pakkanen a405f7a499 Grab base options from the command line. 2016-03-20 20:43:32 +02:00
Jussi Pakkanen 4bb665a577 Merge pull request #464 from tp-m/bool-to-string-and-to-int
Add bool to_string() and to_int() methods.
2016-03-20 18:53:01 +02:00
Tim-Philipp Müller 3eea1703ff Add bool to_string() and to_int() methods
bool to_int() will return 0 or 1, useful if one wants to set
a define to 0 or 1 based on a boolean result instead of having
it just defined or undefined.

bool to_string() will return 'true' or 'false' by default same
as when using it to format a string, but with the additional
possibility to specify two extra string arguments to be returned
as true/false values, e.g. to_string('yes', 'no'). This can be
useful when outputting messages to be shown to the user.
2016-03-19 17:57:11 +00:00
Tim-Philipp Müller fcbd60c291 Add += support for strings and integers 2016-03-19 17:11:53 +00:00
Jussi Pakkanen 8b6848ebc3 Add dir support for find_library and remove deprecated standalone version. Closes #450. 2016-03-17 20:55:19 +02:00
Jussi Pakkanen 19046fd854 Added new base options and some sample opts for gcc. 2016-03-16 21:55:03 +02:00
Jussi Pakkanen 6b548a1c75 Added find_library method and deprecated the standalone version. Closes #396. 2016-03-12 17:00:55 +02:00
Tim-Philipp Müller 3c8468cd4d Add string underscorify() function
So we can easily construct the defines for include headers and
struct checks and such.
2016-03-12 14:15:54 +00:00
Tim-Philipp Müller 02e84df010 Add more string functions: contains(), to_upper() and to_lower() 2016-03-12 14:15:31 +00:00
Nicolas Schneider 5e1fdb8b97 use positional instead of keyword args for add_postconf_script 2016-03-02 21:32:50 +01:00
Nicolas Schneider 9f9f73fa52 add args support for add_postconf_script 2016-03-01 14:31:37 +01:00
Nicolas Schneider 92187501ed Can add postconfigure script. 2016-03-01 14:07:38 +01:00
Jussi Pakkanen 52b66edb6c Can specify compile and link args for internal deps. 2016-02-29 21:28:16 +02:00
Jussi Pakkanen d88223bd61 Do delayed argument setting properly this time. 2016-02-22 21:28:34 +02:00
Nirbheek Chauhan 601ff91622 interpreter: Add path() method to ExternalProgramHolder types
In practice, this means we can do

 flex = find_program('flex')
 flex.path() # Gives the full path to the flex binary
2016-02-17 14:45:50 +05:30
Jussi Pakkanen bbe4656c51 Guard against subdir segments in output files. 2016-02-14 18:54:12 +02:00
Jussi Pakkanen fc08f60b9f Do not cache found programs because it is unreliable. Closes #374. 2016-02-12 23:15:44 +02:00
Jussi Pakkanen 8cd3c8124a Can add languages only if they are available. Closes #365. 2016-01-25 22:39:47 +02:00
Jussi Pakkanen 4cd671e69e More comparison operators. Closes #363. 2016-01-25 22:12:40 +02:00
Jussi Pakkanen 0c96dbff3a String to int conversion. Closes #362. 2016-01-25 21:51:41 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00