From f43dcff695e9ba92dc97f4777a890fc5c5fbdf4e Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sun, 19 Nov 2023 01:13:24 +0100 Subject: [PATCH] cmake: fix `ko_write_gitclone_script` function The value of `ARGV4` is undefined when the number of arguments passed to the function is less than 5. --- thirdparty/cmake_modules/koreader_thirdparty_git.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thirdparty/cmake_modules/koreader_thirdparty_git.cmake b/thirdparty/cmake_modules/koreader_thirdparty_git.cmake index d8f9207a9..1db778082 100644 --- a/thirdparty/cmake_modules/koreader_thirdparty_git.cmake +++ b/thirdparty/cmake_modules/koreader_thirdparty_git.cmake @@ -170,7 +170,9 @@ function(ko_write_gitclone_script script_filename git_repository git_tag build_s set(work_dir ${CMAKE_CURRENT_BINARY_DIR}/git_checkout) set(tmp_dir ${work_dir}/tmp) set(stamp_dir ${work_dir}/stamp) - set(git_submodules ${ARGV4}) + if(ARGC GREATER 4) + set(git_submodules ${ARGV4}) + endif() set(${script_filename} ${tmp_dir}/${PROJECT_NAME}-gitclone-${git_tag}.cmake) set(${script_filename} ${${script_filename}} PARENT_SCOPE)