Skip to content

Commit 6336d53

Browse files
dennisamelingdscho
authored andcommitted
cmake(windows): set correct path to the system Git config
Currently, when Git for Windows is built with CMake, the system Git config is expected in a different location than when building via `make`: the former expects it to be in `<runtime-prefix>/mingw64/etc/gitconfig`, the latter in `<runtime-prefix>/etc/gitconfig`. Because of this, things like `git clone` do not work correctly (because cURL is no longer able to find its certificate bundle that it needs to validate HTTPS certificates). See the full bug report and discussion here: #3071 (comment). This commit aligns the CMake-based build by mimicking what is already done in `config.mak.uname`. This closes #3071. Signed-off-by: Dennis Ameling <[email protected]>
1 parent a04fce6 commit 6336d53

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ list(APPEND compat_SOURCES sha1dc_git.c sha1dc/sha1.c sha1dc/ubc_check.c block-s
200200

201201

202202
add_compile_definitions(PAGER_ENV="LESS=FRX LV=-c"
203-
ETC_GITATTRIBUTES="etc/gitattributes"
204-
ETC_GITCONFIG="etc/gitconfig"
205203
GIT_EXEC_PATH="libexec/git-core"
206204
GIT_LOCALE_PATH="share/locale"
207205
GIT_MAN_PATH="share/man"
@@ -216,10 +214,15 @@ add_compile_definitions(PAGER_ENV="LESS=FRX LV=-c"
216214

217215
if(WIN32)
218216
set(FALLBACK_RUNTIME_PREFIX /mingw64)
219-
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}")
217+
# Move system config into top-level /etc/
218+
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}"
219+
ETC_GITATTRIBUTES="../etc/gitattributes"
220+
ETC_GITCONFIG="../etc/gitconfig")
220221
else()
221222
set(FALLBACK_RUNTIME_PREFIX /home/$ENV{USER})
222-
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}")
223+
add_compile_definitions(FALLBACK_RUNTIME_PREFIX="${FALLBACK_RUNTIME_PREFIX}"
224+
ETC_GITATTRIBUTES="etc/gitattributes"
225+
ETC_GITCONFIG="etc/gitconfig")
223226
endif()
224227

225228

0 commit comments

Comments
 (0)