aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sidrane <david_s5@nscdg.com>2015-01-22 12:28:18 -1000
committerDavid Sidrane <david_s5@nscdg.com>2015-03-05 09:23:24 -1000
commit75e0066577f44007e389b1307822d6c921427716 (patch)
tree9ad802fa52a85e02f850c9d489b2767182ad189c
parentfee931626ade5ce123f40cd42dc2c94531883103 (diff)
downloadpx4-firmware-75e0066577f44007e389b1307822d6c921427716.tar.gz
px4-firmware-75e0066577f44007e389b1307822d6c921427716.tar.bz2
px4-firmware-75e0066577f44007e389b1307822d6c921427716.zip
Added Support for C++ static initializers for all boards. Including compile time checking for proper C++ configuration and not calling up_cxxinitialize redundantly
-rw-r--r--src/drivers/boards/aerocore/module.mk6
-rw-r--r--src/drivers/boards/px4fmu-v1/module.mk6
-rw-r--r--src/drivers/boards/px4io-v1/module.mk6
-rw-r--r--src/drivers/boards/px4io-v2/module.mk6
4 files changed, 24 insertions, 0 deletions
diff --git a/src/drivers/boards/aerocore/module.mk b/src/drivers/boards/aerocore/module.mk
index c1b51cd26..51bf315c0 100644
--- a/src/drivers/boards/aerocore/module.mk
+++ b/src/drivers/boards/aerocore/module.mk
@@ -8,4 +8,10 @@ SRCS = aerocore_init.c \
aerocore_led.c \
../../../modules/systemlib/up_cxxinitialize.c
+ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H))
+ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H))
+ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true))
+SRCS += ../../../modules/systemlib/up_cxxinitialize.c
+endif
+
MAXOPTIMIZATION = -Os
diff --git a/src/drivers/boards/px4fmu-v1/module.mk b/src/drivers/boards/px4fmu-v1/module.mk
index 5a3f5f801..0f56e53d9 100644
--- a/src/drivers/boards/px4fmu-v1/module.mk
+++ b/src/drivers/boards/px4fmu-v1/module.mk
@@ -10,4 +10,10 @@ SRCS = px4fmu_can.c \
px4fmu_led.c \
../../../modules/systemlib/up_cxxinitialize.c
+ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H))
+ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H))
+ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true))
+SRCS += ../../../modules/systemlib/up_cxxinitialize.c
+endif
+
MAXOPTIMIZATION = -Os
diff --git a/src/drivers/boards/px4io-v1/module.mk b/src/drivers/boards/px4io-v1/module.mk
index 40c79da4e..9b3f38f27 100644
--- a/src/drivers/boards/px4io-v1/module.mk
+++ b/src/drivers/boards/px4io-v1/module.mk
@@ -6,4 +6,10 @@ SRCS = px4io_init.c \
px4io_pwm_servo.c \
../../../modules/systemlib/up_cxxinitialize.c
+ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H))
+ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H))
+ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true))
+SRCS += ../../../modules/systemlib/up_cxxinitialize.c
+endif
+
MAXOPTIMIZATION = -Os
diff --git a/src/drivers/boards/px4io-v2/module.mk b/src/drivers/boards/px4io-v2/module.mk
index 15e003599..ff5839c80 100644
--- a/src/drivers/boards/px4io-v2/module.mk
+++ b/src/drivers/boards/px4io-v2/module.mk
@@ -6,4 +6,10 @@ SRCS = px4iov2_init.c \
px4iov2_pwm_servo.c \
../../../modules/systemlib/up_cxxinitialize.c
+ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H))
+ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H))
+ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true))
+SRCS += ../../../modules/systemlib/up_cxxinitialize.c
+endif
+
MAXOPTIMIZATION = -Os