-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
various: Enclose string if checks in quotes #11617
Conversation
Test specificationCI/Jenkins/NRF
CI/Jenkins/integration
Detailed information of selected test modules Note: This message is automatically posted and updated by the CI |
Could you improve the PR description? That is, what kind of issues this might cause? At least I wasn't aware this might be wrong so would like to learn something :) |
@@ -14,7 +14,7 @@ set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configuration/\${BOARD}" | |||
set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") | |||
set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") | |||
|
|||
if(OVERLAY_CONFIG STREQUAL "overlay-factory_data.conf") | |||
if("${OVERLAY_CONFIG}" STREQUAL "overlay-factory_data.conf") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this a possible issue? :)
https://cmake.org/cmake/help/latest/command/if.html#strequal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all of them are issues, it is the ones using variables outside of quotes that are issues, I've updated the rest so that the style throughout the code remains uniform.
@Damian-Nordic I have added a description and example to the original message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good to me, but could you explain in the commit message why this is necessary? Right now it is not clear to me, and I'd like to understand it. Thanks!
79ede0e
to
0ccd0ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. It even fixes some CI toolchain issues
will the IN_LIST => IN LISTS issue be resolved? it looks like an actual error |
|
We have |
Fixes possible issues whereby string variables are checked without being properly encased in quote marks. This is needed because unescaped variables will be treated as variable names, then errors will be emitted when they are dereferenced and those variables do not exist. This fixes issue like the following: ************************* * Running CMake for ncp * ************************* CMake Error at CMakeLists.txt:10 (if): if given arguments: "STREQUAL" "nrf52840dongle_nrf52840" Unknown arguments specified Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes possible issues whereby string variables are checked without being properly encased in quote marks.
This is needed because unescaped variables will be treated as variable names, then errors will be emitted when they are dereferenced and those variables do not exist.
An example of what happens with bad code when configuring a build: