Commit Graph

97 Commits

Author SHA1 Message Date
Andrew Tridgell 9c040105d6 waf: split copter and heli builds
this makes things less confusing for users
2018-04-08 21:26:16 +10:00
Andrew Tridgell 2476a51908 waf: allow for pre_build hook in board modules 2018-03-02 12:52:50 +11:00
Andrew Tridgell 48422e1038 waf: added --default-parameters option 2018-01-15 11:46:02 +11:00
Andrew Tridgell 1901cb6c7f waf: added --disable-header-checks
the headers checks are most of the re-build time when editing class
headers. Disabling them makes development much faster
2017-08-08 00:42:19 -07:00
Lucas De Marchi e68a3e2687 build: rename linstall to localinstall 2017-07-02 08:58:26 -07:00
Gustavo Sousa 374556df22 build: add rsync command
The original proposal was to add this functionality to the --upload option, but
it turns out that --upload seems something slightly different from what the
functionality added with patch does.

The issue motivating this patch is at
https://github.com/ArduPilot/ardupilot/issues/6283
2017-07-02 08:58:26 -07:00
Gustavo Sousa 923e62cb74 build: add linstall command
Command for a local installation under BLD/install, where BLD is the build
variant. This will be useful for commands that depends on the install command.
2017-07-02 08:58:26 -07:00
Eugene Shamaev 59ef501a19 waf: add support for building with UAVCAN 2017-04-10 22:38:13 +01:00
Jacob Walser 25663f5740 wscript: Add Sub 2017-02-25 17:50:18 +11:00
Lucas De Marchi c430bb29e3 build: allow to have unit tests in HAL implementations
Allow a tests/ directory in the hal implementations.
2016-11-02 16:28:20 -02:00
Gustavo Jose de Sousa a98c42fef9 waf: define ap_groups in ardupilotwaf tool
That makes more sense, since that module is supposed to have basic Ardupilot
specific features. The root wscript should be a mere user of those features.
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa b8e518a533 waf: use ap_library tool
That way we avoid recompiling source files that don't depend on vehicles.
Change notes:
- UTILITY_SOURCE_EXTS: moved to ap_library
- Task generators indexes: ap_library handles that now and in a better way
- Use of AP_STLIB_FEATURES: it doesn't make sense anymore, since the stlib
  taskgen has empty source list
- Flags and defines: passed down to ap_library through AP_LIBRARIES_OBJECTS_KW
- Set use='mavlink' in AP_LIBRARIES_OBJECTS_KW instead of calls to
  bld.ap_stlib().
2016-08-24 10:46:23 -03:00
Gustavo Jose de Sousa 6834308fbf waf: always load git_submodule tool
That was a silly mistake done by 65e19fd ("waf: don't update submodules if not
a git repository").
2016-08-19 10:23:43 -03:00
Gustavo Jose de Sousa 5ccd3dfec8 waf: create ap_version taskgen in the corresponding function 2016-08-01 22:04:16 -03:00
Gustavo Jose de Sousa f2dec971e7 waf: add "ap_" prefix to keywords "libraries" and "vehicle"
As an effort to keep things specific to ardupilot API in the build system
consistent and easy way to identify.
2016-08-01 22:04:16 -03:00
Gustavo Jose de Sousa 5edb03d184 waf: add option --no-autoconfig
That is useful for developers working on the build system, so that they can
test the build without having to wait for a reconfiguration.
2016-07-29 16:25:33 -03:00
Gustavo Jose de Sousa b65f63ffc1 waf: keep non-variant options definitions together
Keep definition of options that are stored in the "non-variant" configuration
together.
2016-07-29 16:25:33 -03:00
Gustavo Jose de Sousa f936291a52 waf: set variant of BuildContext classes in configure
Otherwise, a call like `waf configure --board <foo> <command1>` will make
`<command1>` run on wrong variant if there was a different variant configured
previously, or an empty variant if the project is "distcleaned".
2016-07-29 13:06:35 -03:00
Gustavo Jose de Sousa cb1c7b66cb waf: add post build callbacks in separate function
That makes it easier see what callbacks are or not being added and the order
they are executed. While at it, don't add build summary callback when in a
check command.
2016-07-28 17:50:19 -03:00
Gustavo Jose de Sousa ef0fb97fe4 waf: reduce scope of ant_glob() patterns
And reduce pre-build execution time.
2016-07-25 17:45:38 -03:00
Gustavo Jose de Sousa 1ad0c685eb waf: add git_submodule post build callback
So that the user is warned about skipped submodule updates.
2016-07-25 16:45:57 -03:00
Gustavo Jose de Sousa 65e19fd9af waf: don't update submodules if not a git repository
That is useful for releases tarballs.
2016-07-25 16:45:57 -03:00
Lucas De Marchi 2b1b23cabf build: fix static linking through --static option 2016-07-20 18:03:20 -03:00
Lucas De Marchi b375b33189 waf: allow to disable tests
This allows to completely disable the tests. Even the gtest submodule is
not checked out allowing integration on build servers without needing to
download one more submodule.

This is different from the --notests flag. The latter only disables
executing the tests, but always use the submodule.
2016-07-13 15:38:50 -03:00
Andrew Tridgell 55e91f0325 waf: added --static option
this forces a static build
2016-07-13 15:24:41 -03:00
Lucas De Marchi a9919420c6 waf: allow to disable libiio at configuration
We default to autodetection for libiio so if the libraries are available
we enable it. However this may not always be desired.
2016-06-23 19:08:13 -03:00
Lucas De Marchi 348678888b waf: allow to disable lttng at configuration
We default to autodetection for LTTNG so if the libraries are available
we enable it. However this may not always be desired.
2016-06-23 19:07:26 -03:00
Gustavo Jose de Sousa d3ed17f047 waf: reconfigure for any changes in loaded modules
Waf's autoconfig feature works only for wscripts loaded by the recurse()
function. This patch extends that functionality to all loaded modules, which
includes Waf tools.
2016-06-23 18:22:55 -03:00
Gustavo Jose de Sousa 2566a13e1b waf: use Configure.autoconfig = 'clobber'
That makes reconfiguration be automatically triggered when wscripts used in
configuration are changed.
2016-06-23 18:22:55 -03:00
Lucas De Marchi 0af8b42ade build: include ap_config.h in libgtest
This is also needed while compiling libgtest because it's using our
cmath wrapper header. Otherwise it will end up entering the
"ifndef WAF_BUILD" part and fail to compile on gcc 5.3.1.
2016-06-14 15:42:43 -03:00
Gustavo Jose de Sousa 260de62f94 waf: print build summary 2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa afcabda21c waf: use better style for add_option() calls
Setting the "help" keyword argument may not fit in one line sometimes. This
patch adds the following convention to calls to add_option() in order to
address that issue in a better way:

    1) The "help" keyword must always be the last argument to be passed.

    2) If the help string is a literal string or a literal string with some
    operation (e.g. "%" operator) and setting the "help" keyword in the code
    doesn't fit a line (considering the limit of characters in a line), then
    the help string must be a triple-quoted string. That has the advantage of
    not having to have several "+" operations for long help strings. In that
    case, the help message must start on the next line and the closing
    triple-quotes must be on a separate line together with the closing
    parenthesis.

The requirement (1) makes it easier to make the style exception in (2)
acceptable.
2016-05-25 17:47:00 -03:00
Gustavo Jose de Sousa 844222870c waf: boards: bind get_board() to configure and build contexts
A convenience, since we don't expect the board to change for a given
configuration.
2016-05-25 17:47:00 -03:00
Andrew Tridgell 7e7c21d114 waf: update for MAVLink2 build 2016-05-21 15:25:17 +10:00
Gustavo Jose de Sousa 0e09d0b996 waf: rename config_header variable to config_hash
That's a better name. The other name would give the wrong idea that that
variable would store a path to the header.
2016-05-20 09:45:53 -03:00
Lucas De Marchi a9ae5476f3 waf: fix configure not using WAF_BUILD
The configure phase need the WAF_BUILD var defined, otherwise it will
execute code that's only meant for the make build system.
2016-05-19 09:53:41 -03:00
Lucas De Marchi 11e508e3a6 waf: define WAF_BUILD to allow different behavior in make 2016-05-18 22:56:50 -03:00
Gustavo Jose de Sousa 472dae3ed9 waf: don't use hard-coded path for environment cache path
The path for the "non-board" environment cache file was hard-coded, which was
causing the error below when the build was configured with the --out option
value different from the default path.

Traceback (most recent call last):
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Scripting.py", line 161, in waf_entry_point
    run_commands()
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Scripting.py", line 263, in run_commands
    ctx = run_command(cmd_name)
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Scripting.py", line 247, in run_command
    ctx.execute()
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Scripting.py", line 598, in execute
    return execute_method(self)
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Build.py", line 250, in execute
    self.execute_build()
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Build.py", line 263, in execute_build
    self.recurse([self.run_dir])
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Context.py", line 304, in recurse
    user_function(self)
  File "/home/gjsousa/ardupilot/wscript", line 246, in build
    config_header = Utils.h_file(bld.bldnode.make_node('ap_config.h').abspath())
  File "/home/gjsousa/ardupilot/modules/waf/waflib/Utils.py", line 208, in h_file
    f = open(fname, 'rb')
IOError: [Errno 2] No such file or directory: '/tmp/build/ap_config.h'
2016-05-17 15:48:55 -03:00
Gustavo Jose de Sousa ff46384258 waf: add --debug configuration option
That sets a variant <board>-debug.
2016-05-07 22:55:03 -03:00
Lucas De Marchi 9e3ec3a16d waf: define git versions in a generated ap_version.h header 2016-05-06 13:11:28 -03:00
Lucas De Marchi 5f80858cba waf: use system extensions
In several places we use functions like asprintf() that are only
available in libc when _GNU_SOURCE is defined. Always define _GNU_SOURCE
since we always want to use them.

This fixes the build on Windows using cygwin.
2016-04-19 19:02:25 -03:00
Lucas De Marchi 169c350e85 waf: rename AP_Config.h to ap_config.h
The usual name for this header is config.h, but that's already used by
vehicles. Using uppercase could give the impression this is a
file to be modified, but it's not. Use lowercase instead.
2016-04-05 21:06:25 -07:00
Ricardo de Almeida Gonzaga 5e45c9dfb0 waf: add cxx_checks tool
In order to start generating AP_Config header and detect
parameter such as the existence of cmath functions.
2016-04-05 20:44:15 -07:00
Gustavo Jose de Sousa 93473f68ce waf: use program group for main products build commands
Use program group name instead of task generator name. That way all programs
belonging to a product are built. That will be the case for different frames
for copter.
2016-03-26 15:43:08 -03:00
Gustavo Jose de Sousa 0883fb72ac waf: add shortcut for antennatracker 2016-03-24 12:27:58 -03:00
Gustavo Jose de Sousa 841771096d waf: let toolchain loading in charge of the Board class
That allows boards (i.e. subclasses of Board) to use toolchain related
information for configuration. The upcoming PX4 build is an example.
2016-03-14 11:54:31 -03:00
Gustavo Jose de Sousa 8664c0344d waf: allow boards to tweak build
We define a function build() that can be overrode by Board subclasses.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 76bae701a8 waf: exclude build directory in collect_dirs_to_recurse()
Without this patch, if nodes that don't yet exist in the filesystem in
bld.bldnode were created before calls to this function, they'll be removed from
the tree in memory because "*" is passed to ant_glob() and the "remove" keyword
argument defaults to True.
2016-03-14 11:54:29 -03:00
Gustavo Jose de Sousa 86c1c6da5c waf: fix environment boolean values
It is more natural to use `env.FOO = True` then `env.foo = [True]`.
2016-03-03 14:58:03 -03:00
Gustavo Jose de Sousa c609b27afc waf: gbenchmark: use cmake tool
A little addition in the root wscript was also necessary.
2016-02-22 15:36:48 -03:00