Commit Graph

53 Commits

Author SHA1 Message Date
Daniel Agar 651df03f76 RTPS and micro-CDR build system cleanup (#8084) 2017-10-11 13:05:44 -04:00
Daniel Agar 01b3e6fd25 NuttX upgrade cmake wrapper (#7873)
* NuttX cmake

* px4_macros:Pass the stringified predicate as second arg to static assert

   CC_ASSERT mapes to the c++ static_assert or provides the same
   funtionality for c via the other macros. The c++ static assert
   takes 2 argumants the prdicate and a message. This fixes the
   lacking second argument.

* Updated nuttx and apps submodule to upstream nuttx 7.21+==master

   This is the latest uptake of upstream nuttx and apps.

* ROMFS generate with xxd instead of objcopy

* delete nuttx-patches

* NuttX update submodules to latest px4_nuttx-master

* fix nuttx apps and board dependency

* docker_run update to latest container 2017-08-29

* cmake ROMFS portable sed usage

* NuttX update submodules to latest px4_nuttx-master
2017-09-29 10:13:51 -04:00
Daniel Agar 35e15ed540 cmake add -Wmissing-field-initializers and a few others 2017-09-16 21:29:52 +01:00
Daniel Agar e1a3c53930 cmake posix and qurt impl fix whitespace 2017-06-19 20:24:09 +02:00
Daniel Agar 6a443765a5 cmake only include mavlink where used 2017-06-19 20:24:09 +02:00
Nicolae Rosia a6acb2e68e ARM Toolchain: search compiler in PATH
Add CMake target for strip since these changes break adb_upload_to_bebop.

GCC users should add the cross compiler bin path to PATH (location of arm-linux-gnueabihf-g++).
Clang user should do the following:
* set CMAKE_CXX_COMPILER to clang++ by providing -DCMAKE_CXX_COMPILER=clang++ to cmake
* get GCC cross compiler - needed because Clang does not ship a CRT
* create a symlink for clang and clang++ in GCC cross compiler bin dir.
* add GCC bin dir to PATH

Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
2017-06-13 08:16:37 +02:00
Kabir Mohammed 8b1ca2ea9b Rename RPi/Bebop toolchain locations to PX4_TOOLCHAIN_DIR 2017-06-13 08:16:37 +02:00
Kabir Mohammed f123ade6d3 Rename to generic arm toolchain 2017-06-13 08:16:37 +02:00
Beat Küng e87aa6f6c1 cmake: remove ${PX4_INCLUDE_DIR}visibility.h
This is already added in px4_base.cmake and PX4_INCLUDE_DIR is not set
either.
2017-03-29 23:02:09 +02:00
wangxdflight b693e29d64 enable px4 flight for excelsior(legacy) 2017-01-16 08:25:58 -08:00
Nicolae Rosia 6ffffe3367 Remove invalid eigen reference
This is a left over from cleanup 0acf6db64f

Signed-off-by: Nicolae Rosia <nicolae.rosia@gmail.com>
2017-01-14 10:02:44 -08:00
Carlo Wood 6fc30c76a6 Clean up of app.h
app.h, generated from app.h_in, has unnecessary code duplication
and isn't a header file (it defines globals, static functions
and doesn't have a header guard, moreover, it has a 'using namespace
std;'). Because of this, a real headerfile that declares the stuff
defined in apps.h was missing leading to even more code duplication:
scattered forward declarations in .cpp files and an often repeated
type of std::map<std::string, px4_main_t>.

This patch moves cmake/qurt/apps.h_in to src/platforms/apps.cpp.in
(with some changes) and removes cmake/posix/apps.h_in.
Then src/platforms/apps.cpp.in is split into src/platforms/apps.cpp.in
and src/platforms/apps.h.in, splitting declarations from definitions.

A typedef is defined for the map (apps_map_type).

The main difference between cmake/posix/apps.h_in and
cmake/qurt/apps.h_in was that the first defined a global 'apps',
while qurt stores the apps in QShell. I opted to get rid of
the global variable (which are in general evil for various reasons)
and used the API of cmake/qurt/apps.h_in where a provided 'apps'
map is initialized with a call to init_app_map. Thus removing
the existing code duplication.
2016-10-22 08:31:14 +02:00
Michael Schaeuble 9bb230fa3d Remove obsolete linker flag for Bebop build
The pthread linker flags were changed in c6a2641 and it was questioned in #5504 if the
exception for the Bebop is necessary. It is not, so remove those lines from the cmake
file.
2016-10-18 20:47:19 +02:00
Lorenz Meier 676e90cd98 Define realtime clock for systems not having one 2016-09-27 11:56:49 +02:00
Lorenz Meier 5b674ffe48 Update DF to include Travis CI fix for DF
DF Update: Use common CMake version so Darwin handling is correct in PX4

Update DF to use proper constants

Update DF
2016-09-27 11:56:49 +02:00
Lorenz Meier af8cbee6d5 Support 10.11 and 10.12 in parallel in PX4 2016-09-27 11:56:49 +02:00
Lorenz Meier edf0057cee Modify build for XCode 8 2016-09-27 11:56:49 +02:00
Carlo Wood c6a2641507 Fix some pthread related linker stuff. (#5504)
The px4_os_add_flags defined in cmake/posix/px4_impl_posix.cmake did
add (threading) libraries to added_exe_linker_flags, which subsequently
end up in CMAKE_EXE_LINKER_FLAGS and then have no effect because those
flags are passed to the linker before any of the object files and static
libraries.

Those libraries are already added correctly in the corresponding
src/firmware/*/CMakeLists.txt files (for qurt, nuttx AND posix).

I left in the non-library linker flag '-pthread' for the bebop board,
although it seems very weird to me that this is needed (is it?).
If that is needed then it seems weird to link manually (that is,
src/firmware/*/CMakeLists.txt) with -lpthread.

For linux/g++ -pthread is added to the CXXFLAGS as it should be:
this causes the compiler to define _REENTRANT which is needed
for (the interface of) certain libraries to become thread-safe.
Offically one also can just pass -pthread to the linker, which then
causes the right libraries to be linked, but just linking with
-lpthread -lm -lrt works too.

I ran into this while adding support for libcwd, which explicitly
complains that _REENTRANT isn't defined when trying to link with
the thread-safe version of libcwd (-lcwd_r) and then tells you
to use -pthread.
2016-09-26 22:53:41 +02:00
Carlo Wood 77d356d275 Target specific optimization control.
This allows one to set a semi-colon separated list of regular
expressions in the environment variable PX4_NO_OPTIMIZATION
to control which (cmake generated) targets should be compiled
without optimization.

Suppressing optimization can be necessary for debugging in
a debugger, especially when trying to step through the code
or needing to print variables that otherwise are optimized out.

EXAMPLE

export PX4_NO_OPTIMIZATION="px4;^modules__uORB;^modules__systemlib$"

will result in the following messages during cmake configuration:

[...]
-- Disabling optimization for target 'platforms__posix__px4_layer'
because it matches the regexp 'px4' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__systemlib' because it
matches the regexp '^modules__systemlib$' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__uORB' because it matches
the regexp '^modules__uORB' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'examples__px4_simple_app' because
it matches the regexp 'px4' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'modules__uORB__uORB_tests' because
it matches the regexp '^modules__uORB' in env var PX4_NO_OPTIMIZATION
-- Disabling optimization for target 'px4' because it matches the regexp
'px4' in env var PX4_NO_OPTIMIZATION

Note that a list of all (currently used) target names can be printed
with the following command line from within the required build directory:

find . -wholename '*/CMakeFiles/*.dir/flags.make' | xargs dirname | xargs basename -a | sort -u | sed -e 's/.dir$//'
2016-09-13 16:31:08 +02:00
Carlo Wood 03d176d097 Bug fixes, typos, indentation.
Over time I made a few changes unrelated to what I'm really working on.
These changes are hereby committed first. The bug fixes are related to
what I'm doing in that I need them to be fixed for future commits.

Tools/sitl_run.sh: rename label to rcS_dir and fix usage help.
cmake/common/px4_base.cmake: Remove the check on OUT_UNPARSED_ARGUMENTS,
  and a few typos and indentation issues.
cmake/configs/posix_sitl_replay.cmake: Set the correct variable
  (config_sitl_rcS_dir) to the correct directory.
cmake/nuttx/px4_impl_nuttx.cmake: typos and indentation issues,
  and removal of a redundant FORCE (INTERNAL implies FORCE).
cmake/posix/px4_impl_posix.cmake: typos and indentation issues.
cmake/qurt/px4_impl_qurt.cmake: typos and indentation issues.
src/modules/mavlink/mavlink_ftp.cpp : possible strict-aliasing breakage.

NOTES

The second argument passed to sitl_run.sh is the value of
config_sitl_rcS_dir. This fact is missing from the usage help.
I renamed 'label' to 'rcS_dir' to better reflect this.
Also, for the 'replay' config the wrong variable was set causing
the call to sitl_run.sh to skip an argument and fail (ie the
debugger was passed as rcS_dir and so on).

The check on OUT_UNPARSED_ARGUMENTS in px4_parse_function_args
basically causes every passed IN variable to be REQUIRED and is
therefore a bug. The test for the presence of the REQUIRED arguments
follows directly after and is sufficient for this job. This bug went
unnoticed because currently every argument to OPTIONS, ONE_VALUE,
and MULTI_VALUE is actually passed to the function(s) calling
px4_parse_function_args (them being REQUIRED or not).

The changes in mavlink_ftp.cpp are to avoid a possible aliasing bug
and (mostly) to avoid the compiler warning/error: dereferencing type-
punned pointer will break strict-aliasing rules [-Werror=strict-aliasing].
2016-09-13 16:31:08 +02:00
James Goppert 818840b576 Path cleanup, low impact changes (#5340)
* Low impact changes from path_cleanup branch.

This is a step towards minimizing the diff with path_cleanup branch.

* Update ecl.

* Revert matrix update.

* Revert ecl and matrix.

* Update sitl gazebo.

* Revert sitl_gazebo and matrix changes.
2016-08-18 15:37:23 -04:00
Hidenori a8d3b15d73 RPi: add clang & clang-check support 2016-08-18 16:11:05 +02:00
Lorenz Meier 102f5b54d7 Revert "Improvements to SITL to make paths more flexible. (#5181)"
This reverts commit 699b6a2cb3.
2016-08-05 21:29:49 +02:00
James Goppert 699b6a2cb3 Improvements to SITL to make paths more flexible. (#5181) 2016-08-05 06:23:59 -04:00
Michael Schäuble d9422e0296 Add Parrot Bebop as build target (#4698)
* Add parrot bebop build structure

* Add upload functionality to bebop build

* Add modules and commands to bebop build
2016-05-31 13:04:22 +02:00
jwilson c87a8bedb6 Adding config changes to allow PX4 to be built for the Excelsior board. 2016-05-05 08:34:31 +02:00
Julian Oes 338ccb34f5 apps.h_in: fixed what is presumably a typo 2016-02-19 16:59:46 +01:00
Mark Charlebois 1d59e2c6fb Whitespace fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:44 +01:00
Mark Charlebois 4c9492e10f Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:44 +01:00
Mark Charlebois 50d0771dc0 Whitespace fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:43 +01:00
Mark Charlebois 014f15d8b0 Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:43 +01:00
Mark Charlebois 20f7d3d49f Whitespace fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:42 +01:00
Mark Charlebois 65d89b5b97 Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:41 +01:00
Mark Charlebois 53bf98c630 Fixed HEXAGON_ARM_SYSROOT
This was being reset in px4_impl_posix.cmake

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:41 +01:00
Mark Charlebois 8ca3e8e057 Whitespace fixes
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:41 +01:00
Mark Charlebois 9f3bf8e9f4 Rebase changes on upstream master
This brings in many of the changes from the PX4 fork on ATLFLight.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2016-02-19 16:59:41 +01:00
Mark Charlebois c4438bf50a Fix to move DriverFramework includes to common
Nuttx now gets to link phase. But there are two unresolved symbols:

arm-none-eabi/include/c++/4.7.4/bits/basic_string.h:1128: undefined reference to `std::string::assign(char const*, unsigned int)'
arm-none-eabi/include/c++/4.7.4/bits/stl_list.h:1534: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-19 09:35:18 -08:00
Mark Charlebois 1bcb93180b Set flags for building the proper DriverFramework target
The DF_TARGET cmake variable needs to be set to (linux, darwin, qurt, nuttx)
The define __DF_LINUX or __DF_QURT needs to be set.
The __DF_DARWIN target is untested

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-16 23:24:59 -08:00
Lorenz Meier 54d1302555 Fix missing rt lib 2015-11-10 13:21:13 +01:00
Mark Charlebois 7ddd5712c5 Integrated DriverFramework
Refacored ADCSIM
Compilation succeeds. Link not yet fixed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-10 13:21:13 +01:00
Lorenz Meier e673a25344 Fix flags for OS X 2015-09-11 11:58:04 +02:00
Mark Charlebois 08dc74afac cmake: fixes for qurt build after refactoring
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-10 09:29:21 -07:00
James Goppert d0c89b8396 Attempted to fix qurt build, some cleanup of old module funcs. 2015-09-09 23:11:25 -04:00
James Goppert bf18c84652 Cleanup of module building. 2015-09-09 23:00:58 -04:00
Mark Charlebois 5a59d7d74f cmake: added support for topic_listener.cpp
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-09 10:15:37 -07:00
Mark Charlebois b561215017 cmake: fixes for apps.h generation for posix and qurt
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-08 19:17:53 -07:00
James Goppert 73a328473e Fix for posix linker script. 2015-09-08 21:22:05 -04:00
James Goppert 126325bace Work on posix. 2015-09-08 20:50:18 -04:00
Mark Charlebois 9c8dd69f29 Removed debug
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-08 16:14:11 -07:00
Mark Charlebois 91cf77c68b Added more missing modules for posix
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-08 16:12:45 -07:00