Skip to content

Commit 8cad35f

Browse files
committed
Merge branch 'js/ps-build-cmake-fixup'
Build fixes for Windows. * js/ps-build-cmake-fixup: cmake/vcxproj: stop special-casing `remote-ext` cmake: put the Perl modules into the correct location again cmake: use the correct file name for the Perl header cmake(mergetools): better support for out-of-tree builds cmake: better support for out-of-tree builds follow-up
2 parents 002a8a9 + 2456374 commit 8cad35f

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

config.mak.uname

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,6 @@ vcxproj:
819819
sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \
820820
bin-wrappers/git-{receive-pack,upload-archive}
821821
git add -f $(test_bindir_programs)
822-
# remote-ext is a builtin, but invoked as if it were external
823-
sed 's|receive-pack|remote-ext|g' \
824-
<bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext
825-
git add -f bin-wrappers/git-remote-ext
826822

827823
# Add templates
828824
$(MAKE) -C templates

contrib/buildsystems/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ list(TRANSFORM perl_modules REPLACE "${CMAKE_SOURCE_DIR}/" "")
867867
file(STRINGS ${CMAKE_SOURCE_DIR}/perl/header_templates/fixed_prefix.template.pl perl_header )
868868
string(REPLACE "@PATHSEP@" ":" perl_header "${perl_header}")
869869
string(REPLACE "@INSTLIBDIR@" "${INSTLIBDIR}" perl_header "${perl_header}")
870-
file(WRITE ${CMAKE_BINARY_DIR}/PERL-HEADER ${perl_header})
870+
file(WRITE ${CMAKE_BINARY_DIR}/GIT-PERL-HEADER ${perl_header})
871871

872872
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
873873
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
@@ -882,13 +882,17 @@ foreach(script ${git_perl_scripts} ${perl_modules})
882882
string(REPLACE ".perl" "" perl_gen_path "${script}")
883883

884884
get_filename_component(perl_gen_dir "${perl_gen_path}" DIRECTORY)
885+
if(script MATCHES "\.pm$")
886+
string(REGEX REPLACE "^perl" "perl/build/lib" perl_gen_dir "${perl_gen_dir}")
887+
string(REGEX REPLACE "^perl" "perl/build/lib" perl_gen_path "${perl_gen_path}")
888+
endif()
885889
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/${perl_gen_dir}")
886890

887891
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/${perl_gen_path}"
888892
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/generate-perl.sh"
889893
"${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS"
890894
"${CMAKE_BINARY_DIR}/GIT-VERSION-FILE"
891-
"${CMAKE_BINARY_DIR}/PERL-HEADER"
895+
"${CMAKE_BINARY_DIR}/GIT-PERL-HEADER"
892896
"${CMAKE_SOURCE_DIR}/${script}"
893897
"${CMAKE_BINARY_DIR}/${perl_gen_path}"
894898
DEPENDS "${CMAKE_SOURCE_DIR}/generate-perl.sh"
@@ -1078,7 +1082,7 @@ endif()
10781082

10791083
#wrapper scripts
10801084
set(wrapper_scripts
1081-
git git-upload-pack git-receive-pack git-upload-archive git-shell git-remote-ext scalar)
1085+
git git-upload-pack git-receive-pack git-upload-archive git-shell scalar)
10821086

10831087
set(wrapper_test_scripts
10841088
test-fake-ssh test-tool)
@@ -1087,19 +1091,22 @@ set(wrapper_test_scripts
10871091
foreach(script ${wrapper_scripts})
10881092
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10891093
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1094+
string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
10901095
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/${script}${EXE_EXTENSION}" content "${content}")
10911096
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
10921097
endforeach()
10931098

10941099
foreach(script ${wrapper_test_scripts})
10951100
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
10961101
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1102+
string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
10971103
string(REPLACE "@PROG@" "${CMAKE_BINARY_DIR}/t/helper/${script}${EXE_EXTENSION}" content "${content}")
10981104
file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content})
10991105
endforeach()
11001106

11011107
file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME)
11021108
string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}")
1109+
string(REPLACE "@TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" content "${content}")
11031110
string(REPLACE "@GIT_TEXTDOMAINDIR@" "${CMAKE_BINARY_DIR}/po/build/locale" content "${content}")
11041111
string(REPLACE "@GITPERLLIB@" "${CMAKE_BINARY_DIR}/perl/build/lib" content "${content}")
11051112
string(REPLACE "@MERGE_TOOLS_DIR@" "${CMAKE_SOURCE_DIR}/mergetools" content "${content}")
@@ -1192,7 +1199,7 @@ string(REPLACE "@GIT_TEST_TEXTDOMAINDIR@" "'${CMAKE_BINARY_DIR}/po/build/locale'
11921199
string(REPLACE "@GIT_TEST_POPATH@" "'${CMAKE_BINARY_DIR}/po'" git_build_options "${git_build_options}")
11931200
string(REPLACE "@GIT_TEST_TEMPLATE_DIR@" "'${CMAKE_BINARY_DIR}/templates/blt'" git_build_options "${git_build_options}")
11941201
string(REPLACE "@GIT_TEST_GITPERLLIB@" "'${CMAKE_BINARY_DIR}/perl/build/lib'" git_build_options "${git_build_options}")
1195-
string(REPLACE "@GIT_TEST_MERGE_TOOLS_DIR@" "'${RUNTIME_PREFIX}'" git_build_options "${git_build_options}")
1202+
string(REPLACE "@GIT_TEST_MERGE_TOOLS_DIR@" "'${CMAKE_BINARY_DIR}/mergetools'" git_build_options "${git_build_options}")
11961203
string(REPLACE "@RUNTIME_PREFIX@" "'${RUNTIME_PREFIX}'" git_build_options "${git_build_options}")
11971204
string(REPLACE "@GITWEBDIR@" "'${GITWEBDIR}'" git_build_options "${git_build_options}")
11981205
string(REPLACE "@USE_GETTEXT_SCHEME@" "" git_build_options "${git_build_options}")

0 commit comments

Comments
 (0)