Skip to content

Commit b266bf9

Browse files
rzrhaesik
authored andcommitted
build: Fix mistake while testing TARGET_BOARD (#1892)
Preprocessor can't use == on strings", so new symbols are introduced to test configurations at build time. Note, this mistake was harmless because there weren't any spefic parts among boards, but this will change in upcoming change. Change-Id: I45d87cccc086af05661eaf7b762a4a0274fb2ede Relate-to: rzr/webthing-iotjs#3 Forwarded: #1892 IoT.js-DCO-1.0-Signed-off-by: Philippe Coval p.coval@samsung.com
1 parent 3eeb8f2 commit b266bf9

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ endif()
125125

126126
# Add board-dependant flags
127127
iotjs_add_compile_flags(-DTARGET_BOARD=${TARGET_BOARD})
128+
string(TOUPPER ${TARGET_BOARD} TARGET_BOARD_UPPER)
129+
string(CONCAT TARGET_BOARD_SYMBOL "TARGET_BOARD_" ${TARGET_BOARD_UPPER})
130+
iotjs_add_compile_flags(-D${TARGET_BOARD_SYMBOL}=1)
128131

129132
if("${TARGET_BOARD}" STREQUAL "artik05x")
130133
iotjs_add_compile_flags(-mcpu=cortex-r4 -mfpu=vfp3)

src/modules/nuttx/iotjs_module_stm32f7nucleo-nuttx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16-
#if defined(__NUTTX__) && (TARGET_BOARD == stm32f7nucleo)
16+
#if defined(__NUTTX__) && defined(TARGET_BOARD_STM32F7NUCLEO)
1717

1818
#include "iotjs_systemio-nuttx.h"
1919
#include "stm32_gpio.h"

src/platform/nuttx/iotjs_systemio-nuttx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
* limitations under the License.
1414
*/
1515

16-
#if defined(__NUTTX__) && \
17-
(TARGET_BOARD == stm32f4dis || TARGET_BOARD == stm32f7nucleo)
16+
#if defined(__NUTTX__) && (defined(TARGET_BOARD_STM32F4DIS) || \
17+
(defined(TARGET_BOARD_STM32F7NUCLEO)))
1818

1919
#include <stdint.h>
2020

0 commit comments

Comments
 (0)