Skip to content

Commit

Permalink
build: Fix mistake while testing TARGET_BOARD (#1892)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rzr authored and haesik committed Jun 20, 2019
1 parent 3eeb8f2 commit b266bf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ endif()

# Add board-dependant flags
iotjs_add_compile_flags(-DTARGET_BOARD=${TARGET_BOARD})
string(TOUPPER ${TARGET_BOARD} TARGET_BOARD_UPPER)
string(CONCAT TARGET_BOARD_SYMBOL "TARGET_BOARD_" ${TARGET_BOARD_UPPER})
iotjs_add_compile_flags(-D${TARGET_BOARD_SYMBOL}=1)

if("${TARGET_BOARD}" STREQUAL "artik05x")
iotjs_add_compile_flags(-mcpu=cortex-r4 -mfpu=vfp3)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/nuttx/iotjs_module_stm32f7nucleo-nuttx.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/

#if defined(__NUTTX__) && (TARGET_BOARD == stm32f7nucleo)
#if defined(__NUTTX__) && defined(TARGET_BOARD_STM32F7NUCLEO)

#include "iotjs_systemio-nuttx.h"
#include "stm32_gpio.h"
Expand Down
4 changes: 2 additions & 2 deletions src/platform/nuttx/iotjs_systemio-nuttx.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* limitations under the License.
*/

#if defined(__NUTTX__) && \
(TARGET_BOARD == stm32f4dis || TARGET_BOARD == stm32f7nucleo)
#if defined(__NUTTX__) && (defined(TARGET_BOARD_STM32F4DIS) || \
(defined(TARGET_BOARD_STM32F7NUCLEO)))

#include <stdint.h>

Expand Down

0 comments on commit b266bf9

Please sign in to comment.