Commit Graph

336 Commits

Author SHA1 Message Date
Bruce Richardson 9a29496a9b clarify old behaviour of set_variable in documentation [skip ci]
Thanks to PR #3483, set_variable can be used to assign array values.
However, the fact that it cannot be used for arrays before 0.46.1 needs
a mention in the documentation, since otherwise users can get unexpected
dependencies on later meson versions.
2018-09-20 19:00:42 +03:00
Jussi Pakkanen f2041405fb
Merge pull request #4017 from jon-turney/version-comparison-rewrite
Use rpmvercmp version comparison
2018-09-13 22:19:35 +03:00
Jon Turney 8b3ad3e9a0 Add a release note snippet
Also tweak releated documentation
2018-09-12 15:38:00 +01:00
Nirbheek Chauhan 1819dc851a
Document version when both_libraries() was added [skip ci] 2018-09-11 19:38:06 +05:30
Dylan Baker 51e9db370a Add method to check for C/C++ function attributes
It's fairly common on Linux and *BSD platforms to check for these
attributes existence, so it makes sense to me to have this checking
build into meson itself. Autotools also has a builtin for handling
these, and by building them in we can short circuit cases that we know
that these don't exist (MSVC).

Additionally this adds support for two common MSVC __declspec
attributes, dllimport and dllexport. This implements the declspec
version (even though GCC has an __attribute__ version that both it and
clang support), since GCC and Clang support the MSVC version as well.
Thus it seems reasonable to assume that most projects will use the
__declspec version over teh __attribute__ version.
2018-09-07 11:52:15 -07:00
Nirbheek Chauhan 226eaba369 Reference-manual: Clarify fallback dependency types [skip ci] 2018-09-04 22:50:17 -07:00
Rafael Ávila de Espíndola 07d2d88fa9 Allow override_find_program to use an executable.
With this it is now possible to do

foobar = executable('foobar', ...)
meson.override_find_program('foobar', foobar)

Which is convenient for a project like protobuf which produces both a
dependency and a tool. If protobuf is updated to use
override_find_program, it can be used as

protobuf_dep = dependency('protobuf', version : '>=3.3.1',
                          fallback : ['protobuf', 'protobuf_dep'])
protoc_prog = find_program('protoc')
2018-09-03 21:24:01 +03: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 fb770e1e3d Add support for custom dist scripts. 2018-08-27 23:35:29 +03:00
Jon Turney 7fff8318f5
Add a release note snippet
Also adjust relevant documentation
2018-08-26 17:23:39 +01:00
Jussi Pakkanen 54aed1a92c Added "native" kwarg to add_XXX_args. Closes #3669. 2018-08-22 23:22:48 +03:00
Xavier Claessens 4f088365e4 interpreter: Add support for dict addition 2018-08-14 23:46:42 +03:00
Jussi Pakkanen fb2cdd0fe2 Call it gnu_symbol_visibility instead. 2018-08-09 19:46:49 +03:00
Jussi Pakkanen d7d948db0d Update documentation for symbol visibility. 2018-08-09 19:46:49 +03:00
Onkar c9aea4e11c Clarify version for check_header, fixes #3974
check_header method was added in compiler object in version 0.47. Documentation needs to be updated for this.
2018-08-04 18:18:25 +03:00
Nirbheek Chauhan a2dab5439c custom targets: Add a 'console' kwarg for long-running commands
Ninja buffers all commands and prints them only after they are
complete. Because of this, long-running commands such as `cargo
build` show no output at all and it's impossible to know if the
command is merely taking too long or is stuck somewhere.

To cater to such use-cases, Ninja has a 'pool' with depth 1 called
'console', and all processes in this pool have the following
properties:

1. stdout is connected to the program, so output can be seen in
   real-time
2. The output of all other commands is buffered and displayed after
   a command in this pool finishes running
3. Commands in this pool are executed serially (normal commands
   continue to run in the background)

This feature is available since Ninja v1.5

https://ninja-build.org/manual.html#_the_literal_console_literal_pool
2018-07-31 19:38:54 +03:00
Jussi Pakkanen f67630d26c Removed extra parentheses. [skip ci] 2018-07-20 18:40:58 +03:00
Nirbheek Chauhan 78f1ef85fd
Add missing method on external library object: type_name() (#3845)
For some reason this was missing, but it should've always existed
since cc.find_library() returns an object that is internally an
ExternalDependency instance.
2018-07-08 10:58:07 -07:00
Nirbheek Chauhan a37c31e8a3 Reference-manual.md: Document find_library().partial_dependency() [skip ci]
+ typos.
2018-07-06 19:14:21 +05:30
Nirbheek Chauhan 8e84b13850 meson.add_install_script: Move notes section up [skip ci]
The notes section of add_install_script somehow got separated, which
meant that no one reads it anymore.

Also rephrase it a bit to clarify that scripts *MUST* handle DESTDIR
correctly to mirror what Meson does, and how.
2018-07-05 19:01:46 +00:00
Jussi Pakkanen 1ec3c79056 Documentation cleanup. [skip ci] 2018-07-02 20:35:00 +03:00
Jon Turney 8b12a71f22 Refine documentation for build_always [skip ci]
We mention this is equivalent to setting both build_by_default and
build_always_stale in the release note, and in the warning emitted when it's
used, but not in the reference manual.
2018-06-26 23:05:01 +03:00
Nirbheek Chauhan 86684ad798 Document environment() append/prepend/set with multiple values [skip ci]
Fixes https://github.com/mesonbuild/meson/issues/3761
2018-06-20 13:27:23 +00:00
Alex Hirsch cbe18e01e4 Deprecate `build_always`, add `build_always_stale`
Since `build_always` also adds a target to the set of default targets,
this option is marked deprecated in favour of the new option
`build_always_stale`.

`build_always_stale` *only* marks the target to be always considered out
of date, but does *not* add it to the set of default targets.

The old behaviour can still be achieved by combining
`build_always_stale` with `build_by_default`.

fixes #1942
2018-06-18 10:49:40 +00:00
Xavier Claessens e565945253 Add UserFeatureOption type
This is a special type of option to be passed to most 'required' keyword
arguments. It adds a 3rd state to the traditional boolean value to cause
those methods to always return not-found even if the dependency could be
found.

Since integrators doesn't want enabled features to be a surprise there
is a global option "auto_features" to enable or disable all
automatic features.
2018-06-18 04:57:32 +00:00
Jon Turney 8d5361bb1d Wrap a line in a way that doesn't break link [skip ci] 2018-06-17 15:26:11 +03:00
Christoph Behle b08902a60f Improved documentation.
Added entry to release notes.
Added note to documentation, regarding from which version on the
behavior is changed.
2018-06-12 00:14:54 +00:00
Christoph Behle 219fcfad14 Document change in reference manual. 2018-06-12 00:14:54 +00:00
Jon Turney 2e29f37b0e Document values for dependency(method:) [skip ci]
We say 'different dependencies support different values for this', but
nowhere document what values are supported, so the only way to find these
out is to read the source, or guess. Make a start at doing that.
2018-06-10 01:47:51 +00:00
Sander Sweers 38fa281448 Add new encoding keyword for configure_file to manual
Also add a section how to deal with file encodings.
2018-06-09 18:17:48 +00:00
Jon Turney 1f5c6d62bf More clearly explain portability issues with linking to a module
Refine #3277

According to what I read on the internet, on OSX, both MH_BUNDLE (module)
and MH_DYLIB (shared library) can be dynamically loaded using dlopen(), but
it is not possible to link against MH_BUNDLE as if they were shared
libraries.

Metion this as an issue in the documentation.

Emitting a warning, and then going on to fail during the build with
mysterious errors in symbolextractor isn't very helpful, so make attempting
this an error on OSX.

Add a test for that.

See also:
https://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm
https://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-osx
2018-06-07 12:57:39 +00:00
Jon Turney 7e08e958c0 Allow substitutions in custom_target() depfile:
Allow substitutions in custom_target() depfile: as well as in command:
2018-06-03 21:06:23 +00:00
Jon Turney 50aabc0129 Document @PLAINNAME@ and @BASENAME@ substitutions in custom_target(command:)
Since f3ff8fe6 (0.39.0), this has a common implementation with the same
substitution in generators, but I think they existed earlier.

@BASENAME@ is used internally by the custom target generated by
windows.compile_resources()
2018-06-03 21:06:23 +00:00
Filipe Brandenburger 73decf31f1 Update reference manual to include 'install_mode' where supported 2018-06-02 04:50:32 +00:00
Mathieu Duponchelle 14750b50ea configure_file: Add output_format kwarg (#3636)
* configure_file: Add output_format kwarg

* docs: Reference-manual.md output_format was added in 0.47 [skip ci]
2018-06-01 17:53:07 +00:00
Dylan Baker 17cb364046 [skip ci] docs: cross reference tables from manual (#3656)
* docs/reference-manual: link to references tables

Currently the reference manual entries for *machine.cpu_family() and
*machine.system() have incomplete (and wrong) information. Rather than
continue to duplicate this information just link to the reference
tables.

* docs/Reference-manual: fix link target

The IDs in hotdoc are always lowered, so this pointed to the right page,
but didn't go to the heading.

* docs/Reference-manual: link compiler.get_id directly to tables

Currently it goes round about to an entry that doesn't add much
information and points to the reference table. Instead just point to the
reference table.
2018-06-01 15:19:36 +00:00
Jon Turney 809336833c Improve dependency() documentation [skip ci]
Mention that the dependency name will also be searched for as a framework on
OSX.

Note that additional dependency-specific keywords may be used by custom
dependency lookup.
2018-05-31 13:15:47 +00:00
Nirbheek Chauhan 27b290d6df Add check_header to Reference manual and release notes [skip ci] 2018-05-30 15:25:39 +05:30
Nirbheek Chauhan c87c42b736
Document how to set the default name_prefix and name_suffix [skip ci]
Else people (like me) try to use the old behaviour where
setting it to `''` would use the default.

https://gitlab.gnome.org/GNOME/glib-networking/issues/33
2018-05-30 13:27:24 +05:30
Jussi Pakkanen cc3e0bc469
Merge pull request #3491 from jeandet/qt_private_headers
Qt private headers
2018-05-27 23:50:30 +03:00
Jussi Pakkanen 55a0831bc3
Merge pull request #3383 from mesonbuild/nirbheek/configure-file-nodata
configure_file: Add a new action 'copy'
2018-05-22 21:09:19 +03:00
Jussi Pakkanen 9ecd92c6fe
Merge pull request #3490 from MathieuDuponchelle/dict_builtin
Add new built-in type, dict
2018-05-22 20:46:26 +03:00
Andrei Alexeyev 2e2d14c9d7
Update documentation for run_command [skip ci] 2018-05-22 04:45:40 +03:00
Mathieu Duponchelle fe6fc59ee7 dict: add since annotations 2018-05-22 00:17:42 +02:00
Nirbheek Chauhan 4b9393e165 docs: Add manual entry for configure_file copy kwarg 2018-05-22 02:37:07 +05:30
Mathieu Duponchelle 1de7dce414 dict: Document, add release snippet 2018-05-20 22:39:33 +02:00
Nirbheek Chauhan e9a181a545
docs: Add a warning about find_program().path()
See: https://github.com/mesonbuild/meson/issues/3552
2018-05-09 18:30:00 +05:30
Nirbheek Chauhan 43f9318afa
Reference-manual: compiler checks
Document that compiler checks are self-contained and
do not add arguments from anywhere else.
2018-05-09 14:43:08 +05:30
Alexis Jeandet 51868d00e7 [Qt module] Privates headers: added documentation
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2018-04-28 17:45:23 +02:00
Xavier Claessens 9a82b0136a extract_all_objects: Add 'recursive' keyword argument
To maintain backward compatibility we cannot add recursive objects by
default. Print a warning when there are recursive objects to be pulled
and the argument is not set. After a while we'll do pull recursive
objects by default.
2018-04-18 14:54:52 -04:00
Jussi Pakkanen 628f910760
Merge pull request #3314 from sarum9in/test_depends
Add test(depends) keyword parameter
2018-04-18 00:40:52 +03:00
Dylan Baker 92487ea33d Add partial_dependency method to dependencies
This adds a new method, partial_dependency to all dependencies. These
sub dependencies are copies of the original dependency, but with one or
more of the attributes replaced with an empty list. This allows creating
a sub dependency that has only cflags or drops link_arguments, for
example.
2018-04-17 23:33:31 +03:00
Xavier Claessens bd37afeeea Add has_link_argument() and friends
Closes: #3335.
2018-04-16 19:14:02 -04:00
Nirbheek Chauhan 0e6a332d0c Document that override_find_program works on configure_file [skip ci]
Also link to the release notes snippet from the Reference manual
2018-04-15 13:32:38 +05:30
Jussi Pakkanen f489aa77e5 Added documentation [skip ci] 2018-04-15 13:32:38 +05:30
Alberto Sartori 717f7db67e improve suite of meson test (#3369) 2018-04-14 22:17:02 +03:00
David Fort 6dea177774 add support for cmakedefine in configure_file()
The added format argument for configure_file allows to specify the kind of
file that is treated. It defaults to 'meson', but can also have the 'cmake'
or 'cmake@' value to treat config.h.in files in the cmake format with #cmakedefine
statements.
2018-04-08 22:00:45 +03:00
Xavier Claessens 68f9846b7c Add both_libraries() to build both shared and static libraries
Also support default_library='both' to make library() build both shared
and static libraries.

Closes #484
2018-04-03 15:38:01 -04:00
behlec 37d379ebe5 Allow meson build file to exit early. (#2808) 2018-03-29 21:29:45 +03:00
Aleksey Filippov 780d301c1c Add test(depends) documentation 2018-03-25 01:33:33 +00:00
Alistair Thomas 3b9f4098ef docs: In executable() remove statement that all other files are ignored [skip ci]
Currently Meson returns an error that no compiler can be found
for an unknown file extension
2018-03-23 21:09:32 +02:00
Alistair Thomas 47f71d1a41 docs: Update test() to include that a program found with find_program() can be used [skip ci] 2018-03-23 21:09:32 +02:00
Jussi Pakkanen 30827b5644 Do not install configure_file output if install_dir is empty. Closes #3270. 2018-03-21 21:25:47 +02:00
Aleksey Filippov d63fff06d9 Add install_data() rename documentation 2018-03-19 22:13:34 +00:00
Aleksey Filippov 98fc7a82dc Link "External commands" page from run_command() reference [skip ci] 2018-03-12 13:44:31 +00:00
Jon Turney ffe6ed2a47 doc: Tweak text about get_option('foodir') in reference manual [skip ci]
* The example for executable()'s install_dir: should use join_paths()

* Clarify how to use directory options which are potentially not prefix
relative

This is mentioned in https://github.com/mesonbuild/meson/issues/1637 and see
also https://patchwork.freedesktop.org/patch/200373/ for an example of this
usage, and the possible confusion that can arise.
2018-03-07 19:57:20 +02:00
Jussi Pakkanen e98ae58d0e
Merge pull request #3086 from sarum9in/declare-link-whole
Add declare_dependency() link_whole parameter
2018-03-06 21:08:54 +02:00
Evgenii Shatokhin 19718a8d9c Allow passing a compiler object to run_command()
Sometimes it is needed to run the current compiler with specific options
not to compile a file but rather to obtain additional info. For example,
GCC has several -print-* options to query it about the paths to
different libraries and development files. One use case is to get the
location of development files for GCC plugins, which is not easily
obtainable by other means:

  gcc -print-file-name=plugin

For this purpose, it would be convenient if the compiler object returned
by meson.get_compiler(lang) could be used in run_command() directly.
This commit implements it.

Signed-off-by: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
2018-03-06 21:07:16 +02:00
Nirbheek Chauhan 9e18e4c703
Improve vcs_tag documentation [skip ci]
Document that dependencies must be explicitly signalled, just like with a custom target.
2018-03-06 15:33:00 +05:30
Aleksey Filippov 4de02cb5b0 Document declare_dependency() link_whole parameter 2018-03-06 01:44:26 +00:00
Jussi Pakkanen 38145e0251 The "outputs" kwarg should be "output" and rewrapping. Closes #3166. [skip ci] 2018-03-04 00:57:42 +02:00
Aleksey Filippov 15537f5e8e Add links to Subprojects.md page from subproject() and subproject object documentation [skip ci] 2018-03-01 21:52:08 +02:00
Aleksey Filippov 5e6c47a4b2 Add reference to implicit_include_directories from include_directories() [skip ci]
Closes #3153
2018-03-01 15:30:15 +00:00
Peter Hutterer 6b550ae91f Allow for missing install_dir in install_data()
The documentation doesn't require it and the interpreter code works around the
possibility of it being None. The ninja backend code however fails with

File "/home/whot/code/meson/mesonbuild/backend/ninjabackend.py", line 796, in generate_data_install
    dstabs = os.path.join(subdir or None, plain_f)
File "/usr/lib64/python3.6/posixpath.py", line 78, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

If install_dir is missing, default to datadir/projectname
2018-02-22 20:26:16 +02:00
Nirbheek Chauhan 86e8d587cb docs: Add subproject warning for source_root and build_root [skip ci] 2018-02-20 16:45:27 +05:30
Eric Engestrom 8a2d9e0ad4 docs: fix missing backtick 2018-02-19 23:46:34 +05:30
Sami Kerola 70a7cf30a1 Re-link remaining github wiki urls to mesonbuild.com site 2018-02-11 13:39:46 +02:00
Jon Turney 0774f319e8 Don't use --export-dynamic on Cygwin
After PR #2662, running test case common/125 shared module/ on Cygwin gets
me:

$ ninja -C _build
ninja: Entering directory `_build'
[7/7] Linking target prog.exe.
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE+ targets, did you mean --export-all-symbols?

Also, fix doc for correct version of first apperance.

Future work: Notwithstanding the hint that ld gives, these options are not
equivalent, and it's not clear we should be using it here:
--export-all-symbols is the default behaviour, and if the exports are
restricted by explicit annotations or a .def file, this option might be
overriding that...
2018-02-08 23:51:06 +02:00
Jon Turney 7bfcf68777 Add get_pkgconfig_variable(default:)
Also use that to squelch the warning for internal uses which handle the
variable missing case (just gnome at the moment)

A follow up to PR #2914
2018-02-08 00:35:38 +02:00
Aleksey Filippov f5917d261c Use text keyword for directory example code blocks 2018-02-05 01:28:07 +00:00
Aleksey Filippov 65afa967d0 Add strip_directory=true example for multi-component path 2018-02-05 01:28:07 +00:00
Aleksey Filippov 79d8f2adbf Fix misprint in strip_directory example 2018-02-05 01:28:07 +00:00
Aleksey Filippov 13f91840e3 Clarify multi-component source directory behavior of install_subdir() 2018-02-05 01:28:07 +00:00
Aleksey Filippov 549f9a41e5 Rename install_subdir() option elide_directory to strip_directory 2018-02-05 01:28:07 +00:00
Aleksey Filippov 8ca3cc0c3d Add elide_directory keyword for install_subdir() function
If elide_directory=true install_subdir() installs directory contents
instead of directory itself, eliding name of the source directory.

Closes #2869.
2018-02-05 01:28:07 +00:00
Jussi Pakkanen 4637cf4e95 Fix run target documentation. Closes #1793. 2018-02-04 19:06:02 +02:00
Martin Kelly 36aca4cd3c add meson.project_license() builtin
This Fixes #2941.
2018-01-31 23:54:28 +02:00
Jussi Pakkanen d6bed2a77d
Merge pull request #2764 from mesonbuild/generatorpath
Generator outputs can have path segments
2018-01-13 19:00:38 +02:00
Nikita Churaev de8018a17d Add `export_dynamic` argument to `executable`. (#2662) 2018-01-09 21:36:13 +02:00
Nirbheek Chauhan 2d08c190d0 docs: get_option returns relative paths for xxxdir options
[skip ci]
2018-01-02 19:01:34 +05:30
Nirbheek Chauhan de3feb9625
docs: find_program native: is available since 0.43 2017-12-28 04:27:38 +05:30
Jussi Pakkanen 34c03719a3 Added documentation. 2017-12-18 21:10:14 +02:00
Iñigo Martínez 514d21e6a4 docs: Add documentation to dependency variables
Meson is able to redefine variables when retrieving them from
 `pkg-config` dependencies. However, the documentation is missing.

This patch adds documentation for this feature.
2017-12-12 18:33:04 +00:00
Jussi Pakkanen 04d5d017c5 Fix documentation on disabler behaviour with short circuiting. 2017-12-11 22:21:39 +02:00
Jussi Pakkanen e674434389 Updated version number for new release. 2017-12-10 17:56:27 +02:00
Ernestas Kulik 7ae5716f67 Touch up install_dir() documentation
It no longer removes the target tree before copying files.
2017-12-09 01:52:33 +02:00
Jussi Pakkanen bc83c58d37
Merge pull request #2731 from mesonbuild/disabler
Created disabler object type
2017-12-05 01:10:50 +02:00
Jussi Pakkanen d3dcef7efc Added documentation for disabler objects. 2017-12-05 01:09:15 +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
Zbigniew Jędrzejewski-Szmek 01ab4acf7f docs: note when warning() was added
Followup for 1540e615f1.
2017-11-29 21:13:49 +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
Jussi Pakkanen 5bc1009109 Add if_found kwarg to subdir(). 2017-11-27 23:22:47 +02:00
Josh Soref 7d1a1fd5b0 spelling: programming 2017-11-26 05:57:58 +00:00
Dylan Baker a52c22dc06 docs: add documentation for config_tool variable method 2017-11-23 20:06:23 -08:00
Joergen Ibsen 6d85e10df9 docs: fix description of default_options
For dependency() and subproject(), the default_options argument can
override the defaults in the subproject's meson_options.txt, not in
its project() invocation.

Resolves #2612
2017-11-13 22:55:45 +02:00
Jussi Pakkanen 49eb33ff55
Merge pull request #2000 from t-chaik/tchaik/wip/get-unquoted
config data: add .get_unquoted() convenience method to get quoted string unquoted
2017-11-13 22:54:39 +02:00
Jussi Pakkanen cde0f4fca1
Merge pull request #2562 from 1ace/fix/mesontest
Remove references to `mesontest`
2017-10-31 22:17:47 +02:00
Paulo Antonio Alvarez 1540e615f1 interpreter: Add warning function 2017-10-31 22:17:01 +02:00
Eric Engestrom b690c26aa2 docs: remove references to `mesontest`
`mesontest` is deprecated, and shouldn't be suggested to users anymore.
2017-10-31 10:10:57 +00:00
Kevin Anderson 562c50f229 Update references from mesonconf to meson configure
Fixes #2372
2017-10-23 18:43:39 +02:00
Luis Menina 92866d8d5f docs: Remove unnecessary trailing whitespaces 2017-10-23 18:43:04 +02:00
Nirbheek Chauhan 0c3d58baba Update Reference-manual.md 2017-10-03 06:57:46 +00:00
Nirbheek Chauhan f10b15930b Update Reference-manual.md
Fix documentation breakage from https://github.com/mesonbuild/meson/pull/2415
2017-10-03 05:49:24 +00:00
xarkes a28db4577a Fix typo and clarify library documentation 2017-10-03 01:15:30 +03:00
Mohammed Sadiq 35313c2a85 docs: Fix typo
Remove the quote before parens
2017-10-02 12:26:20 +01:00
Niklas Claesson 68275b32e8 Implement capture for generators 2017-09-29 23:29:44 +03:00
Dylan Baker dda5e8cadb Allow CustomTarget's to be indexed
This allows a CustomTarget to be indexed, and the resulting indexed
value (a CustomTargetIndex type), to be used as a source in other
targets. This will confer a dependency on the original target, but only
inserts the source file returning by index the original target's
outputs. This can allow a CustomTarget that creates both a header and a
code file to have it's outputs split, for example.

Fixes #1470
2017-09-27 22:01:24 +03:00
Nirbheek Chauhan 92318c7660 docs: get_supported_arguments was added in 0.43.0
Closes https://github.com/mesonbuild/meson/issues/2371

[noci]
2017-09-26 10:00:28 +00:00
Jussi Pakkanen bea6b1a6f6 Merge pull request #2187 from centricular/fix-pcap-dependency
Fix pcap dependency, str.strip() now takes an argument, add cc.get_return_value()
2017-09-22 22:04:18 +03:00
Nirbheek Chauhan 751d59d952 Update Reference-manual.md
Add notes about not using full_path() unless absolutely necessary.
2017-09-20 21:05:50 +00:00
Nirbheek Chauhan 6c38b1f281 docs: Document the new str.strip() feature 2017-09-20 13:39:24 +05:30
Nirbheek Chauhan 140c463b01 Add detail to the command: kwarg of custom targets 2017-09-20 06:55:54 +00:00
Jussi Pakkanen 076f3c53bd Merge pull request #2263 from ximion/dlang
d: Add an easy way to use D-specific features
2017-09-18 20:23:56 +03:00
Matthias Klumpp c3c37fac38 docs: Document the D support 2017-09-17 21:36:23 +02:00
Martin Blanchard 777cd24063 get-unquoted: Mention get_unquoted() in reference manual 2017-09-15 22:43:01 +02:00
Jussi Pakkanen 7de61aac12 Clarify that MESONINTROSPECT may have multiple parts. 2017-09-12 21:20:29 +03:00
Jussi Pakkanen 72a6683c6f Permit overriding find_program from the cross file. 2017-09-04 22:47:12 +03:00
Daniel Stone 552c15b978 Alphabetize compiler.compiles() 2017-08-31 20:24:21 +01:00
Daniel Stone e1ffae0580 Add Compiler.get_supported_arguments()
Add a helper for the common pattern of:
  args_to_use = []
  foreach arg : candidate_args
    if cc.has_argument(arg)
      args_to_use += arg
    endif
  endforeach

Replaced with:
  args_to_use = cc.get_supported_arguments(candidate_args)
2017-08-31 20:24:20 +01:00
Jussi Pakkanen 01effa7178 Rewrap the rest of reference manual. 2017-08-21 00:02:47 +03:00
Jussi Pakkanen bb67d64c8d The last of the alphabetization. 2017-08-20 23:58:54 +03:00
Jussi Pakkanen 04d87c7b5d And a few more alphas. 2017-08-20 23:39:40 +03:00
Jussi Pakkanen b7b66fe516 More alphabetization. 2017-08-20 23:32:06 +03:00
Jussi Pakkanen 2d575757d6 Put some keyword arguments into alphabetical order to improve readability. 2017-08-20 23:16:27 +03:00
TingPing 8a636052bd docs: Clarify project() no longer requires a language 2017-08-19 14:31:47 -04:00
Jussi Pakkanen 62aabb5a8b Missing version info added. 2017-08-17 15:28:59 +03:00
Jussi Pakkanen e76ed84677 Documented the merge_from method. 2017-08-17 15:25:05 +03:00
Florian Zwoch 3fda1ba3ed docs: fix generator code sample 2017-08-17 00:21:42 +03:00
Nirbheek Chauhan b663937f8c Clarify what an "external dependency" is
And add a link to the Dependencies.md page.
2017-08-09 10:32:25 +00:00
Jussi Pakkanen 06f195e9ec Merged exclude_dir branch. 2017-08-06 13:09:46 +03:00
Elliott Sales de Andrade 5cb1d00537 Allow excluding files from `install_subdir`
The install_subdir command now accepts a new `exclude` keyword argument
that allows specified files to be excluded from the installed
subdirectory.
2017-08-06 03:58:35 -04:00
Elliott Sales de Andrade d9f01ffcea Disallow language keyword for unsupported deps.
Also, document it in the manual.
2017-08-05 16:44:39 -04:00
Jussi Pakkanen 61a05f26e3 Add option to disable implicit include directories. Closes #2139. 2017-08-05 00:26:13 +03:00
Jussi Pakkanen bff37a90fc Merged buildrpath branch. 2017-07-21 22:19:07 +03:00
Jussi Pakkanen 979efce04a Merge pull request #1955 from jon-turney/exe-implib
Support implibs for executables on Windows
2017-07-21 20:06:46 +03:00
Jussi Pakkanen e82edc179f Check for manual attempts to set rpath and update docs. 2017-07-21 19:40:54 +03:00
Nirbheek Chauhan 26834a6198 Link to compiler properties for compiler ids list
[skip ci]
2017-07-21 11:29:30 +00:00
Nirbheek Chauhan 93d1b2989e Updates to the reference manual
Typos, add details about how subprojects work, document compiler ids.
2017-07-21 10:33:58 +00:00
Jon Turney 8f859a5105 Make the name of the executable implib configurable 2017-07-20 21:11:56 +01:00
Jon Turney 3fa3922cea Support implibs for executables on Windows
Add a boolean 'implib' kwarg to executable().  If true, it is permitted to
use the returned build target object in link_with:

On platforms where this makes sense (e.g. Windows), an implib is generated
for the executable and used when linking.  Otherwise, it has no effect.

(Rather than checking if it is a StaticLibrary or SharedLibary, BuildTarget
subclasses gain the is_linkable_target method to test if they can appear in
link_with:)

Also install any executable implib in a similar way to a shared library
implib, i.e. placing the implib in the appropriate place

Add tests of:
- a shared_module containing a reference to a symbol which is known (at link
time) to be provided by the executable
- trying to link with non-implib executables (should fail)
- installing the implib

(This last one needs a little enhancement of the installed file checking as
this is the first install test we have which needs to work with either
MSVC-style or GCC-style implib filenames)
2017-07-20 21:11:56 +01:00
Alexis Jeandet e1b24765af Removed minor typos in documentation.
Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
2017-07-17 16:44:51 +02:00
Adam C. Foltzer 69b18cf7e9 rename `crate_type` to `rust_crate_type` per @TingPing 2017-06-14 08:39:41 -07:00
Adam C. Foltzer bdd4c45b17 Enhance Rust support
- Adds a `crate_type` kwarg to library targets, allowing the different
  types of Rust [linkage][1].
- Shared libraries use the `dylib` crate type by default, but can also
  be `cdylib`
- Static libraries use the `rlib` crate type by default, but can also
  be `staticlib`
- If any Rust target has shared library dependencies, add the
  appropriate linker arguments, including rpath for the sysroot of the
  Rust compiler

[1]: https://doc.rust-lang.org/reference/linkage.html
2017-06-09 15:14:02 -07:00
Jan Chren (rindeal) bafc607ab1 Update reference manual and release notes 2017-06-07 23:51:20 +02:00
Bálint Aradi 706b3cafab Add version for configure_file extension in reference manual 2017-06-03 16:51:58 +02:00
Bálint Aradi 28dededf08 Update reference manual and release notes 2017-06-03 16:51:58 +02:00
Chris Mayo 0e9852a457 docs: Fix broken page links 2017-06-03 16:03:04 +03:00
Jussi Pakkanen 189784b474 Merge pull request #1792 from jon-turney/custom_target_vs_module_defs
Allow vs_module_defs to use a custom_target
2017-05-21 21:31:14 +03:00
Jon Turney 75099510f1 docs: The return value of executable() is a builttarget object.
Make executable() consistent with all other functions returning a
buildtarget, it's return type is a buildtarget object.
2017-05-19 18:00:42 +01:00
Jon Turney cad8386733 docs: Document the object returned by custom_target 2017-05-19 18:00:29 +01:00
Jon Turney f12a7f2ad0 docs: Correct list of things that are a build target to include shared_module 2017-05-19 17:01:46 +01:00
Jon Turney 5c7f9797c3 docs: Move "build target object" from "build-in objects" to "returned objects"
Also move "run result" object so objects are sorted alphabetically
2017-05-19 17:01:43 +01:00
Jon Turney 66a6ea984b Allow vs_module_defs to use a custom_target
Allow vs_module_defs to use a custom_target
Add a test and update documentation
2017-05-16 19:56:32 +01:00
Jon Turney e99cfdfbc7 Make vs_module_defs: do something for gcc on Windows as well
Module definition files may be useful when building with gcc on Windows also
(e.g. if the existing build uses them, if exports are aliased, if we were
retro enough to export by ordinal, etc.)

Add the .def file to the link command line when using gcc on Windows

Run the appropriate windows tests irrespective of compiler.
2017-05-12 18:56:43 +03:00
Jussi Pakkanen 1e14438a38 Merge pull request #1735 from dcbaker/list-of-files
Allow passing a list of Files to CustomTarget. Closes #1720
2017-05-12 18:54:46 +03:00
Peter Hutterer 73494c9927 docs: make the required argument for find_program stick out more 2017-05-11 22:39:47 +03:00
Dylan Baker c03744cccb Allow passing a list of Files to CustomTarget. Closes #1720 2017-05-11 09:57:38 -07:00
Dylan Baker e2567386f1 Use flatten for link targets. Fixes #1764 2017-05-11 09:57:38 -07:00
Jussi Pakkanen 1a87c967f1 Merge pull request #1761 from keszybz/docs
Some simple doc fixes
2017-05-11 00:15:58 +03:00
Zbigniew Jędrzejewski-Szmek 65450459de docs: add puncuation to description of compiler object functions 2017-05-09 14:51:01 -04:00
Zbigniew Jędrzejewski-Szmek ed9f79b8a4 docs: mention $DESTDIR in add_install_script description, add punctuation
Although not stricly necessary, it is good to mention $DESTDIR in the
explanation for add_install_script, since it might not be obvious for the
user that it is available.

Also add punctuation to be consistent.

v2:
- fix "witht" typo
- reword $DESTDIR description to say that it is inherited from the environment
- also describe $MESONINTROSPECT
2017-05-09 12:10:35 -04:00
Tim-Philipp Müller df48be051c docs: how to make find_program() search additional directories
Fixes #1702
2017-05-09 09:20:21 +01:00
Zbigniew Jędrzejewski-Szmek 0a8621a9bd docs: add hyperlinks and a short description of unity builds
At first I thought this is something about Ubuntu ;)
2017-05-08 20:12:29 -04:00
Dylan Baker 7053d9abfd Allow link_depends to take strings, Files or generated objects. Closes #1172
Currently only strings can be passed to the link_depends argument of
executable and *library, which solves many cases, but not every one.
This patch allows generated sources and Files to be passed as well.

On the implementation side, it uses a helper method to keep the more
complex logic separated from the __init__ method. This also requires
that Targets set their link_depends paths as Files, and the backend is
responsible for converting to strings when it wants them.

This adds tests for the following cases:
- Using a file in a subdir
- Using a configure_file as an input
- Using a custom_target as an input

It does not support using a generator as an input, since currently that
would require calling the generator twice, once for the -Wl argument,
and once for the link_depends.

Also updates the docs.
2017-05-08 20:59:46 +02:00
Alberto Aguirre ccab7d64f4 Add support for @CURRENT_SOURCE_DIR@ in generator arguments
Allow users to specify @CURRENT_SOURCE_DIR@ in generator arguments
to specify the current target source directory.
This is useful when creating protobuf generator objects in sub-directories
because protoc will then generate files in the expected location.

Fixes #1622.

Remove stray semicolon

Update documentation
2017-05-08 20:53:57 +02:00
Jon Turney 855715b29e docs: make project(license:) a separate bullet point 2017-05-08 20:08:56 +02:00
Peter Hutterer 7a3be163cb Default to project_version() in vcs_tag fallback 2017-05-05 08:11:28 +10:00
Peter Hutterer 4378655a39 docs: document additional args for vcs_tag
Supported as of 223596d7bf
2017-05-05 08:11:04 +10:00
Peter Hutterer e982d5118e docs: clarify that vcs_tag output can be used as source
"you should put in your main program" is confusing, "that can be used as
source" is slightly better.
2017-05-05 08:11:04 +10:00
Peter Hutterer ca924451ac Use American English: behaviour -> behavior 2017-05-04 22:09:27 +03:00
Dylan Baker 5f1b96a076 docs: Update SharedLibrary vs_module_defs accepts a File object 2017-05-04 00:18:22 +03:00
Elliott Sales de Andrade f9de195d7c doc: Replace kwarg with keyword argument.
This abbreviation is a Python-ism that is not really clear to those out
of the loop.
2017-05-03 16:20:53 -04:00
Elliott Sales de Andrade f3ad633f55 doc: Fix several minor typos. 2017-05-03 16:20:53 -04:00
Elliott Sales de Andrade b80d40c287 doc: Capitalize things more consistently.
Upper or lower case depending on the official spelling, or the more
consistent usage.
2017-05-03 16:20:51 -04:00
Peter Hutterer 71f0a63fb2 docs: fix link to file a new issue 2017-05-03 21:00:36 +10:00
Thibault Saunier b371875e02 docs: Import the website and wiki and build with hotdoc
This allows us to more easily have the documentation in sync with
the source code as people will have to document new features etc
right at the time where they implement it.
2017-04-26 17:56:33 +03:00