cmake: get: using NOT DEFINE BUILD_VERSION instead of NOT BUILD_VERSION
If user is specifying `-DBUILD_VERSION=<value>` then the proper way to test is using `NOT DEFINED BUILD_VERSION`. The difference between `NOT DEFINED BUILD_VERSION` and `NOT BUILD_VERSION` is that a user specifying `-DBUILD_VERSION=0` will result in `NOT BUILD_VERSION` becoming true, whereas `NOT DEFINED BUILD_VERSION` would be false, which is the correct behavior here, as the user actually provided a specific BUILD_VERSION. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
09a31ce18c
commit
8ff65f4087
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
# https://cmake.org/cmake/help/latest/module/FindGit.html
|
||||
find_package(Git QUIET)
|
||||
if(NOT BUILD_VERSION AND GIT_FOUND)
|
||||
if(NOT DEFINED BUILD_VERSION AND GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --abbrev=12 --always
|
||||
WORKING_DIRECTORY ${ZEPHYR_BASE}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue