Commit Graph

22 Commits

Author SHA1 Message Date
Lucas De Marchi 3d29010366 build: allow to pass flags to cmake
These are flags to cmake itself, not to the compiler and is not in the
form of -DXX=YY
2017-02-06 09:27:22 -08:00
Gustavo Jose de Sousa a6b55d90a7 waf: cmake: define a dictionary of supported generators
On Windows, using MSYS Makefiles generator doesn't work very well when the
CMakeLists.txt files use custom commands with paths as arguments. Furthermore,
MinGW Makefiles generator can't be used if sh.exe is in the system's path and
some build systems rely on sh for certain tasks (which is the case of PX4
Firmware build). Because of that, the list of generators for Windows has been
narrowed to Ninja and NMake Makefiles.
2016-08-24 12:15:42 -03:00
Gustavo Jose de Sousa a748c52f06 waf: bump to version 1.9.0
Some things worth mentioning:

- That version contains commits we had cherry picked on our submodule.
- There's a patch on top with a fix for the new process spawning used on
  version 1.9.0. That has already been applied to upstream's master, but not
  released yet.
- This patch also does necessary changes on our build system in order to
  accommodate the upgrade. Basically:
  - Use full task class names when calling create_task().
  - Use always_run class attribute instead of the decorator, which is
    deprecated.
2016-06-29 11:18:22 -03:00
Gustavo Jose de Sousa 03728ac2f7 waf: cmake: enable minimum version checking
By using the environment variable CMAKE_MIN_VERSION.
2016-06-03 09:55:17 -03:00
Gustavo Jose de Sousa fee5053493 waf: cmake: reconfigure when configuration data change
Create a new configuration task a configuration in the CMakeConfig object
changes. That allows building targets for different configurations in one waf
build run.
2016-05-25 11:51:40 -03:00
Gustavo Jose de Sousa ce0ae66b19 waf: cmake: add CMAKE_VARS to task uid()
To allow the correct multiple instantiations of the cmake_configuration tasks
for different states CMake variables.
2016-05-25 11:51:40 -03:00
Gustavo Jose de Sousa b6a5052a97 waf: cmake: use CMakeConfig class instead of taskgen
That will make it easier to allow reconfiguration of cmake builds on a single
waf build run.
2016-05-25 11:51:40 -03:00
Gustavo Jose de Sousa 2f324c056f waf: cmake: live output!
Waf buffers command output and spit it after the command is done. For external
builds, that might give the wrong impression that the build stalled.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 1f60e9e3e8 waf: cmake: refactor methods to accept cmake_config parameter
That makes methods more flexible for use.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa b0e7fe26d5 waf: cmake: fix target processing for cmake_build
Accept passing a single Node object to target option.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 07700a821c waf: cmake: add method get_cmake_bldnode()
That allows a user to have access to the cmake build node before the configure
task generator is posted.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa b077613f28 waf: cmake: use BLUE color for cmake tasks 2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 03146c5d15 waf: cmake: move cmake build task creation to a function
That enables other tools to create the task directly.
2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 049abec55b waf: cmake: add keyword parameter cmake_output_patterns 2016-03-14 11:54:30 -03:00
Gustavo Jose de Sousa 4f82120c8f waf: cmake: improve documentation regarding target option
That feature can also be used within wscripts with no problem. The code added
in the example shows that.
2016-03-14 11:54:29 -03:00
Gustavo Jose de Sousa 1233022c78 waf: cmake: synchronize cmake build tasks of same configuration
Running cmake build tasks of the same configuration in parallel my cause race
condition.
2016-02-27 03:15:45 -03:00
Gustavo Jose de Sousa 181b6f5c2e waf: cmake: do a clean configuration
We need to remove CMakeCache.txt, otherwise cached variables would remain the
old value when they are removed from cmake_vars parameter.

We use `os.remove()` instead of `Node.delete()` because the latter removes the
node instance from its parent's children list. That makes the node be ignored
when storing persistent information after the build, thus the node signature
wouldn't be saved with that approach, which would make waf always think that
the task should be executed.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa eacf9d8a0e waf: cmake: declare CMAKE_BLD_DIR as a value dependency
Since we set that value to the task's cwd property, we need to declare it as a
value dependency of cmake_configure_task.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa 6c914349d0 waf: cmake: define proper uid() functions
The default implementation takes into account the task's output and input
nodes. That isn't very well applicable for cmake tasks, so we define proper
uid() methods.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa b5f20459e7 waf: cmake: set CMakeCache.txt as output of cmake_configure task
That provides the behavior we implemented in runnable_status(). Thus, we don't
have to override that method anymore.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa ed288ed345 waf: cmake: ensure order of cmake_vars
We need to ensure the order in which the variables are defined to avoid
unnecessary execution of the configuration task.
2016-02-22 15:36:48 -03:00
Gustavo Jose de Sousa e883242c31 waf: cmake: add Waf tool 2016-02-22 15:36:48 -03:00