handle STREQUAL when variable is not defined

This commit is contained in:
cooldome 2021-07-28 20:26:56 +01:00 committed by profound1987
parent 2d438d8ce0
commit 97760e3633
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ list(APPEND CFLAGS -DARCH_RISCV)
string(TOUPPER ${CHIP} CHIP_NAME) string(TOUPPER ${CHIP} CHIP_NAME)
list(APPEND CFLAGS -D${CHIP_NAME}) list(APPEND CFLAGS -D${CHIP_NAME})
if(${CHIP} STREQUAL "bl602") if("${CHIP}" STREQUAL "bl602")
list(APPEND CFLAGS -DCONFIG_SET_TX_PWR) list(APPEND CFLAGS -DCONFIG_SET_TX_PWR)
endif() endif()

View File

@ -9,7 +9,7 @@ list(APPEND GLOBAL_LD_FLAGS -Wall -Wchar-subscripts -std=c99)
list(APPEND GLOBAL_LD_FLAGS --specs=nano.specs) list(APPEND GLOBAL_LD_FLAGS --specs=nano.specs)
if(${SUPPORT_FLOAT} STREQUAL "y") if("${SUPPORT_FLOAT}" STREQUAL "y")
list(APPEND GLOBAL_LD_FLAGS -u _printf_float) list(APPEND GLOBAL_LD_FLAGS -u _printf_float)
endif() endif()

View File

@ -193,7 +193,7 @@ if(DEFINED APP)
foreach(cmakelists_file ${cmakelists_files}) foreach(cmakelists_file ${cmakelists_files})
get_filename_component(app_relative_dir ${cmakelists_file} DIRECTORY) get_filename_component(app_relative_dir ${cmakelists_file} DIRECTORY)
get_filename_component(app_name ${app_relative_dir} NAME) get_filename_component(app_name ${app_relative_dir} NAME)
if(${APP} STREQUAL "all") if("${APP}" STREQUAL "all")
message(STATUS "[run app:${app_name}], path:${app_relative_dir}") message(STATUS "[run app:${app_name}], path:${app_relative_dir}")
add_subdirectory(${app_relative_dir}) add_subdirectory(${app_relative_dir})
set(app_find_ok 1) set(app_find_ok 1)