Skip to content

Commit 12c1fe4

Browse files
tejlmandjhedberg
authored andcommitted
cmake: fix git dependency for version.h creation
Fixes: #63610 Fix a variable spelling mistake which caused a required dependency to not be set. Together with this fix, then remove an unneeded CMake cache update. The `ZEPHYR_GIT_INDEX-NOTFOUND` value is not really useful in this case as a not set var will also ensure that Zephyr is checked to be a git repo or not. And when detected as a git repo, then `ZEPHYR_GIT_INDEX` is set to correct value. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent c0a349e commit 12c1fe4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,9 @@ endif()
511511
if(DEFINED BUILD_VERSION)
512512
set(build_version_argument "-DBUILD_VERSION=${BUILD_VERSION}")
513513
elseif(NOT ZEPHYR_GIT_INDEX)
514-
set(ZEPHYR_GIT_INDEX ZEPHYR_GIT_INDEX-NOTFOUND CACHE PATH
515-
"Path to Zephyr git repository index file")
516514
if(EXISTS ${ZEPHYR_BASE}/.git/index)
517-
set(ZEPHYR_GIT_DIR ${ZEPHYR_BASE}/.git/index CACHE PATH
518-
"Path to Zephyr git repository index file" FORCE)
515+
set(ZEPHYR_GIT_INDEX ${ZEPHYR_BASE}/.git/index CACHE PATH
516+
"Path to Zephyr git repository index file")
519517
elseif(EXISTS ${ZEPHYR_BASE}/.git)
520518
# Likely a git-submodule. Let's ask git where the real database is located.
521519
find_package(Git QUIET)
@@ -535,7 +533,7 @@ elseif(NOT ZEPHYR_GIT_INDEX)
535533
message(WARNING "BUILD_VERSION: git rev-parse warned: ${stderr}")
536534
endif()
537535
set(ZEPHYR_GIT_INDEX ${zephyr_git_dir}/index CACHE PATH
538-
"Path to Zephyr git repository index file" FORCE)
536+
"Path to Zephyr git repository index file")
539537
endif()
540538
else()
541539
message(WARNING "Could not find git installation, "

0 commit comments

Comments
 (0)