Commit Graph

119 Commits

Author SHA1 Message Date
Gustavo Jose de Sousa 46449ee032 waf: mavgen: use output_dir instead of target
The option target for the waf task generator is meant for actual files that are
going to be build. Since our target files are dynamic, let's change the code to
use a new parameter output_dir instead.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa 282c254897 waf: define include path for mavlink only if necessary
By using the export_includes, the include paths for mavlink are enabled only
for libs or programs that depend on it.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa 17e5d99509 waf: allow partial builds with new mavlink as submodule
The task generator for the mavlink headers is given a name 'mavlink' and is
added as a dependency to all local static libraries, because all of them use
sources that include mavlink headers. It would be nice to have a good way to
detect sources that use mavlink headers or to declare list of libraries that
use the headers, so that the dependency could be added automatically.

Additionally, there's a minor change in syntax for the task generator: using
strings directly instead of lists.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa e5c66de554 waf: mavgen: ensure order without bld.add_group()
This is a better approach, because there's no need of calling add_group() for
each time a mavgen task generator is created.
2016-01-15 07:28:48 +11:00
Siddharth Bharat Purohit 11b82474de waf: generate mavlink headers for waf build 2016-01-15 07:28:47 +11:00
Gustavo Jose de Sousa e21d41afe3 waf: enable fully static linking
Some boards (e.g. bebop) require fully statically linked binaries.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa e7312a1f81 waf: add toolchain tool for cross-compiling 2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa 7aa43d36d2 waf: process board and project configuration before toolchain
Several boards require cross compilation. The objective of this change is to
allow to specify the target architecture in the board definition, so that the
correct toolchain is selected. The cross compilation mechanism will be
implemented in the next commits.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa d6b4e98a88 waf: remove already fixed TODOs
The TODOs removed with this patch were already fixed. Below is the explanation
for each.

 - TODO: add support for unit tests.
    - Supported already added.

 - TODO: Check if we should simply use the signed 'waf' "binary" (after
   verifying it) instead of generating it ourselves from the sources.
    - We're using a submodule for waf.

 - TODO: evaluate if we need shortcut commands for the common targets
   (vehicles). currently using waf --targets=NAME the target name must contain
   the board extension so make it less convenient, maybe hook to support
   automatic filling this extension?
    - There's no need of adding the extension anymore.

 - TODO: Once HAL patches get in, need to filter out the HAL based on the
   bld.env.BOARD.
    - The board-specific HAL library folders is indicated in
      bld.env.AP_LIBRARIES.
2016-01-09 14:08:07 -02:00
Gustavo Jose de Sousa b5a364504a waf: make each board a build variant
With that, we don't have to recompile unnecessarily when switching between
boards. Now, each board has it's own build directory in build/<board_name>.
2016-01-05 10:21:42 -02:00
Caio Marcelo de Oliveira Filho 6856950bd3 waf: use ConfigSet for board environments
Instead of a dictionary of dictionaries, have a dictionary of
ConfigSets. Using ConfigSet have two benefits: (1) allow easily copying
values from other, (2) have syntax for specifying the keys directly as
attributes.

With this change now it's easier to specify minlure without
repetition. New boards can override a value, append or prepend depending
on the need.

DEFINES attribute is treated as a dictionary instead of a list, so
that's easier to override values (at expense of ordering). When reading
the board environment, the code converts back to a list.

The board configuration is now stored in a separate file, there's also a
function to get the boards names.
2015-12-03 07:54:32 +11:00
Gustavo Jose de Sousa 16eceec09f waf: add command 'list_boards'
The command will be used to allow travis script to know which boards are
already supported by the waf build system. This is useful while the transition
to the new build system is on going. The command can be removed when the
transition is done and it's not used anywhere besides travis script.
2015-12-03 07:54:32 +11:00
Gustavo Jose de Sousa 2828f66a6a waf: enable writing and building benchmarks 2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa e2790f4f3b waf: use -O3 for all current boards 2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa 6b4a6f5389 waf: use gtest for tests
It was implemented in such a way that gtest is required only if the user wants
to build and run tests. Initially we're considering all tests should be gtests.
We can change that assumption in the future if necessary.
2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa 8556b5dfb8 waf: add support to run (unit) tests
We're currently using the tests standard error for reporting tests. We can add
TAP later to integrate with other tools.

Additionally, this patch simplifies the exclude patterns passed to
collect_dirs_to_recurse.
2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa d77b308f72 waf: make collect_dirs_to_recurse() accept list of patterns 2015-12-03 07:54:31 +11:00
Lucas De Marchi 3be4144b72 waf: enable clang build database
This database allows to integrate clang tools and compilers with editors and
IDEs.
2015-12-03 07:54:30 +11:00
Caio Marcelo de Oliveira Filho 6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00