mirror of
https://github.com/git/git.git
synced 2026-06-24 08:48:31 +00:00
Merge branch 'ps/libgit-in-subdir' into seen
The source files for libgit.a have been moved into a new "lib/" directory to clean up the top-level directory and clearly separate library code. * ps/libgit-in-subdir: Move libgit.a sources into separate "lib/" directory t/helper: prepare "test-example-tap.c" for introduction of "lib/"
This commit is contained in:
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@@ -179,7 +179,7 @@ jobs:
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: 'microsoft/vcpkg'
|
||||
path: 'compat/vcbuild/vcpkg'
|
||||
path: 'lib/compat/vcbuild/vcpkg'
|
||||
- name: download vcpkg artifacts
|
||||
uses: git-for-windows/get-azure-pipelines-artifact@v0
|
||||
with:
|
||||
@@ -189,11 +189,11 @@ jobs:
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
- name: copy dlls to root
|
||||
shell: cmd
|
||||
run: compat\vcbuild\vcpkg_copy_dlls.bat release
|
||||
run: lib\compat\vcbuild\vcpkg_copy_dlls.bat release
|
||||
- name: generate Visual Studio solution
|
||||
shell: bash
|
||||
run: |
|
||||
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
|
||||
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/lib/compat/vcbuild/vcpkg/installed/x64-windows \
|
||||
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
|
||||
- name: MSBuild
|
||||
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
|
||||
@@ -201,7 +201,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
MSVC: 1
|
||||
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
|
||||
VCPKG_ROOT: ${{github.workspace}}\lib\compat\vcbuild\vcpkg
|
||||
run: |
|
||||
mkdir -p artifacts &&
|
||||
eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts NO_GETTEXT=YesPlease 2>&1 | grep ^tar)"
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,4 +1,4 @@
|
||||
[submodule "sha1collisiondetection"]
|
||||
path = sha1collisiondetection
|
||||
path = lib/sha1collisiondetection
|
||||
url = https://github.com/cr-marcstevens/sha1collisiondetection.git
|
||||
branch = master
|
||||
|
||||
@@ -506,10 +506,10 @@ lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)
|
||||
.PHONY: lint-docs-fsck-msgids
|
||||
LINT_DOCS_FSCK_MSGIDS = .build/lint-docs/fsck-msgids.ok
|
||||
$(LINT_DOCS_FSCK_MSGIDS): lint-fsck-msgids.perl
|
||||
$(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.adoc
|
||||
$(LINT_DOCS_FSCK_MSGIDS): ../lib/fsck.h fsck-msgids.adoc
|
||||
$(call mkdir_p_parent_template)
|
||||
$(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \
|
||||
../fsck.h fsck-msgids.adoc $@
|
||||
../lib/fsck.h fsck-msgids.adoc $@
|
||||
lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)
|
||||
|
||||
## Lint: delimited sections
|
||||
|
||||
@@ -21,17 +21,17 @@ ifdef MSVC
|
||||
|
||||
# Generate and include makefile variables that point to the
|
||||
# currently installed set of MSVC command line tools.
|
||||
compat/vcbuild/MSVC-DEFS-GEN: compat/vcbuild/find_vs_env.bat
|
||||
lib/compat/vcbuild/MSVC-DEFS-GEN: lib/compat/vcbuild/find_vs_env.bat
|
||||
@"$<" | tr '\\' / >"$@"
|
||||
include compat/vcbuild/MSVC-DEFS-GEN
|
||||
include lib/compat/vcbuild/MSVC-DEFS-GEN
|
||||
|
||||
# See if vcpkg and the vcpkg-build versions of the third-party
|
||||
# libraries that we use are installed. We include the result
|
||||
# to get $(vcpkg_*) variables defined for the Makefile.
|
||||
ifeq (,$(SKIP_VCPKG))
|
||||
compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat
|
||||
lib/compat/vcbuild/VCPKG-DEFS: lib/compat/vcbuild/vcpkg_install.bat
|
||||
@"$<"
|
||||
include compat/vcbuild/VCPKG-DEFS
|
||||
include lib/compat/vcbuild/VCPKG-DEFS
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -62,7 +62,7 @@ ifeq ($(uname_S),Linux)
|
||||
HAVE_SYSINFO = YesPlease
|
||||
PROCFS_EXECUTABLE_PATH = /proc/self/exe
|
||||
HAVE_PLATFORM_PROCINFO = YesPlease
|
||||
COMPAT_OBJS += compat/linux/procinfo.o
|
||||
COMPAT_OBJS += lib/compat/linux/procinfo.o
|
||||
EXTLIBS += -ldl
|
||||
# centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7.
|
||||
ifneq ($(findstring .el7.,$(uname_R)),)
|
||||
@@ -152,7 +152,7 @@ ifeq ($(uname_S),Darwin)
|
||||
NO_MEMMEM = YesPlease
|
||||
USE_ST_TIMESPEC = YesPlease
|
||||
HAVE_DEV_TTY = YesPlease
|
||||
COMPAT_OBJS += compat/precompose_utf8.o
|
||||
COMPAT_OBJS += lib/compat/precompose_utf8.o
|
||||
BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
|
||||
BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1
|
||||
HAVE_BSD_SYSCTL = YesPlease
|
||||
@@ -161,7 +161,7 @@ ifeq ($(uname_S),Darwin)
|
||||
CSPRNG_METHOD = arc4random
|
||||
USE_ENHANCED_BASIC_REGULAR_EXPRESSIONS = YesPlease
|
||||
HAVE_PLATFORM_PROCINFO = YesPlease
|
||||
COMPAT_OBJS += compat/darwin/procinfo.o
|
||||
COMPAT_OBJS += lib/compat/darwin/procinfo.o
|
||||
|
||||
ifeq ($(uname_M),arm64)
|
||||
HOMEBREW_PREFIX = /opt/homebrew
|
||||
@@ -299,7 +299,7 @@ ifeq ($(uname_O),Cygwin)
|
||||
UNRELIABLE_FSTAT = UnfortunatelyYes
|
||||
OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
|
||||
MMAP_PREVENTS_DELETE = UnfortunatelyYes
|
||||
COMPAT_OBJS += compat/win32/path-utils.o
|
||||
COMPAT_OBJS += lib/compat/win32/path-utils.o
|
||||
FREAD_READS_DIRECTORIES = UnfortunatelyYes
|
||||
endif
|
||||
ifeq ($(uname_S),FreeBSD)
|
||||
@@ -530,17 +530,17 @@ ifeq (/mingw64,$(subst 32,64,$(subst clangarm,mingw,$(prefix))))
|
||||
ETC_GITATTRIBUTES = ../etc/gitattributes
|
||||
endif
|
||||
|
||||
CC = compat/vcbuild/scripts/clink.pl
|
||||
AR = compat/vcbuild/scripts/lib.pl
|
||||
CC = lib/compat/vcbuild/scripts/clink.pl
|
||||
AR = lib/compat/vcbuild/scripts/lib.pl
|
||||
CFLAGS =
|
||||
BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
|
||||
COMPAT_OBJS = compat/msvc.o compat/winansi.o \
|
||||
compat/win32/flush.o \
|
||||
compat/win32/path-utils.o \
|
||||
compat/win32/pthread.o compat/win32/syslog.o \
|
||||
compat/win32/trace2_win32_process_info.o \
|
||||
compat/win32/dirent.o
|
||||
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
|
||||
BASIC_CFLAGS = -nologo -I. -Ilib/compat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
|
||||
COMPAT_OBJS = lib/compat/msvc.o lib/compat/winansi.o \
|
||||
lib/compat/win32/flush.o \
|
||||
lib/compat/win32/path-utils.o \
|
||||
lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
|
||||
lib/compat/win32/trace2_win32_process_info.o \
|
||||
lib/compat/win32/dirent.o
|
||||
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Ilib/compat -Ilib/compat/regex -Ilib/compat/win32 -DSTRIP_EXTENSION=\".exe\"
|
||||
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE
|
||||
# invalidcontinue.obj allows Git's source code to close the same file
|
||||
# handle twice, or to access the osfhandle of an already-closed stdout
|
||||
@@ -580,7 +580,7 @@ endif
|
||||
|
||||
EXTRA_PROGRAMS += headless-git$X
|
||||
|
||||
compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS
|
||||
lib/compat/msvc.o: lib/compat/msvc.c lib/compat/mingw.c GIT-CFLAGS
|
||||
endif
|
||||
ifeq ($(uname_S),Interix)
|
||||
NO_INITGROUPS = YesPlease
|
||||
@@ -731,14 +731,14 @@ ifeq ($(uname_S),MINGW)
|
||||
HAVE_PLATFORM_PROCINFO = YesPlease
|
||||
CSPRNG_METHOD = rtlgenrandom
|
||||
BASIC_LDFLAGS += -municode
|
||||
COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32
|
||||
COMPAT_CFLAGS += -DNOGDI -Ilib/compat -Ilib/compat/win32
|
||||
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
|
||||
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
|
||||
compat/win32/trace2_win32_process_info.o \
|
||||
compat/win32/flush.o \
|
||||
compat/win32/path-utils.o \
|
||||
compat/win32/pthread.o compat/win32/syslog.o \
|
||||
compat/win32/dirent.o
|
||||
COMPAT_OBJS += lib/compat/mingw.o lib/compat/winansi.o \
|
||||
lib/compat/win32/trace2_win32_process_info.o \
|
||||
lib/compat/win32/flush.o \
|
||||
lib/compat/win32/path-utils.o \
|
||||
lib/compat/win32/pthread.o lib/compat/win32/syslog.o \
|
||||
lib/compat/win32/dirent.o
|
||||
BASIC_CFLAGS += -DWIN32
|
||||
EXTLIBS += -lws2_32
|
||||
GITLIBS += git.res
|
||||
|
||||
@@ -62,10 +62,10 @@ if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||
endif()
|
||||
|
||||
if(USE_VCPKG)
|
||||
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
|
||||
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg")
|
||||
if(NOT EXISTS ${VCPKG_DIR})
|
||||
message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
|
||||
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)
|
||||
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat)
|
||||
endif()
|
||||
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows")
|
||||
|
||||
@@ -194,7 +194,7 @@ else()
|
||||
find_program(MSGFMT_EXE msgfmt)
|
||||
if(NOT MSGFMT_EXE)
|
||||
if(USE_VCPKG)
|
||||
set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
|
||||
set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe)
|
||||
endif()
|
||||
if(NOT EXISTS ${MSGFMT_EXE})
|
||||
message(WARNING "Text Translations won't be built")
|
||||
@@ -212,13 +212,14 @@ endif()
|
||||
|
||||
#default behaviour
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
include_directories(${CMAKE_SOURCE_DIR}/lib)
|
||||
add_compile_definitions(GIT_HOST_CPU="${CMAKE_SYSTEM_PROCESSOR}")
|
||||
add_compile_definitions(SHA256_BLK INTERNAL_QSORT RUNTIME_PREFIX)
|
||||
add_compile_definitions(NO_OPENSSL SHA1_DC SHA1DC_NO_STANDARD_INCLUDES
|
||||
SHA1DC_INIT_SAFE_HASH_DEFAULT=0
|
||||
SHA1DC_CUSTOM_INCLUDE_SHA1_C="git-compat-util.h"
|
||||
SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="git-compat-util.h" )
|
||||
list(APPEND compat_SOURCES sha1dc_git.c sha1dc/sha1.c sha1dc/ubc_check.c block-sha1/sha1.c sha256/block/sha256.c compat/qsort_s.c)
|
||||
list(APPEND compat_SOURCES lib/sha1dc_git.c lib/sha1dc/sha1.c lib/sha1dc/ubc_check.c lib/block-sha1/sha1.c lib/sha256/block/sha256.c lib/compat/qsort_s.c)
|
||||
|
||||
|
||||
add_compile_definitions(PAGER_ENV="LESS=FRX LV=-c"
|
||||
@@ -248,43 +249,43 @@ endif()
|
||||
#Platform Specific
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
include_directories(${CMAKE_SOURCE_DIR}/compat/vcbuild/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/include)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE)
|
||||
endif()
|
||||
include_directories(${CMAKE_SOURCE_DIR}/compat/win32)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/lib/compat/win32)
|
||||
add_compile_definitions(HAVE_ALLOCA_H NO_POSIX_GOODIES NATIVE_CRLF NO_UNIX_SOCKETS WIN32
|
||||
_CONSOLE DETECT_MSYS_TTY STRIP_EXTENSION=".exe" NO_SYMLINK_HEAD UNRELIABLE_FSTAT
|
||||
NOGDI OBJECT_CREATION_MODE=1 __USE_MINGW_ANSI_STDIO=0
|
||||
OVERRIDE_STRDUP MMAP_PREVENTS_DELETE USE_WIN32_MMAP
|
||||
HAVE_WPGMPTR ENSURE_MSYSTEM_IS_SET HAVE_RTLGENRANDOM)
|
||||
list(APPEND compat_SOURCES
|
||||
compat/mingw.c
|
||||
compat/winansi.c
|
||||
compat/win32/flush.c
|
||||
compat/win32/path-utils.c
|
||||
compat/win32/pthread.c
|
||||
compat/win32mmap.c
|
||||
compat/win32/syslog.c
|
||||
compat/win32/trace2_win32_process_info.c
|
||||
compat/win32/dirent.c
|
||||
compat/strdup.c)
|
||||
lib/compat/mingw.c
|
||||
lib/compat/winansi.c
|
||||
lib/compat/win32/flush.c
|
||||
lib/compat/win32/path-utils.c
|
||||
lib/compat/win32/pthread.c
|
||||
lib/compat/win32mmap.c
|
||||
lib/compat/win32/syslog.c
|
||||
lib/compat/win32/trace2_win32_process_info.c
|
||||
lib/compat/win32/dirent.c
|
||||
lib/compat/strdup.c)
|
||||
set(NO_UNIX_SOCKETS 1)
|
||||
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
add_compile_definitions(PROCFS_EXECUTABLE_PATH="/proc/self/exe" HAVE_DEV_TTY )
|
||||
list(APPEND compat_SOURCES unix-socket.c unix-stream-server.c compat/linux/procinfo.c)
|
||||
list(APPEND compat_SOURCES lib/unix-socket.c lib/unix-stream-server.c lib/compat/linux/procinfo.c)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
list(APPEND compat_SOURCES compat/darwin/procinfo.c)
|
||||
list(APPEND compat_SOURCES lib/compat/darwin/procinfo.c)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
list(APPEND compat_SOURCES compat/simple-ipc/ipc-shared.c compat/simple-ipc/ipc-win32.c)
|
||||
list(APPEND compat_SOURCES lib/compat/simple-ipc/ipc-shared.c lib/compat/simple-ipc/ipc-win32.c)
|
||||
add_compile_definitions(SUPPORTS_SIMPLE_IPC)
|
||||
set(SUPPORTS_SIMPLE_IPC 1)
|
||||
else()
|
||||
# Simple IPC requires both Unix sockets and pthreads on Unix-based systems.
|
||||
if(NOT NO_UNIX_SOCKETS AND NOT NO_PTHREADS)
|
||||
list(APPEND compat_SOURCES compat/simple-ipc/ipc-shared.c compat/simple-ipc/ipc-unix-socket.c)
|
||||
list(APPEND compat_SOURCES lib/compat/simple-ipc/ipc-shared.c lib/compat/simple-ipc/ipc-unix-socket.c)
|
||||
add_compile_definitions(SUPPORTS_SIMPLE_IPC)
|
||||
set(SUPPORTS_SIMPLE_IPC 1)
|
||||
endif()
|
||||
@@ -305,13 +306,13 @@ if(SUPPORTS_SIMPLE_IPC)
|
||||
|
||||
if(FSMONITOR_DAEMON_BACKEND)
|
||||
add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND)
|
||||
list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-${FSMONITOR_DAEMON_BACKEND}.c)
|
||||
list(APPEND compat_SOURCES compat/fsmonitor/fsm-health-${FSMONITOR_DAEMON_BACKEND}.c)
|
||||
list(APPEND compat_SOURCES compat/fsmonitor/fsm-ipc-${FSMONITOR_OS_SETTINGS}.c)
|
||||
list(APPEND compat_SOURCES compat/fsmonitor/fsm-path-utils-${FSMONITOR_DAEMON_BACKEND}.c)
|
||||
list(APPEND compat_SOURCES lib/compat/fsmonitor/fsm-listen-${FSMONITOR_DAEMON_BACKEND}.c)
|
||||
list(APPEND compat_SOURCES lib/compat/fsmonitor/fsm-health-${FSMONITOR_DAEMON_BACKEND}.c)
|
||||
list(APPEND compat_SOURCES lib/compat/fsmonitor/fsm-ipc-${FSMONITOR_OS_SETTINGS}.c)
|
||||
list(APPEND compat_SOURCES lib/compat/fsmonitor/fsm-path-utils-${FSMONITOR_DAEMON_BACKEND}.c)
|
||||
|
||||
add_compile_definitions(HAVE_FSMONITOR_OS_SETTINGS)
|
||||
list(APPEND compat_SOURCES compat/fsmonitor/fsm-settings-${FSMONITOR_OS_SETTINGS}.c)
|
||||
list(APPEND compat_SOURCES lib/compat/fsmonitor/fsm-settings-${FSMONITOR_OS_SETTINGS}.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -321,7 +322,7 @@ set(EXE_EXTENSION ${CMAKE_EXECUTABLE_SUFFIX})
|
||||
check_include_file(libgen.h HAVE_LIBGEN_H)
|
||||
if(NOT HAVE_LIBGEN_H)
|
||||
add_compile_definitions(NO_LIBGEN_H)
|
||||
list(APPEND compat_SOURCES compat/basename.c)
|
||||
list(APPEND compat_SOURCES lib/compat/basename.c)
|
||||
endif()
|
||||
|
||||
check_include_file(sys/sysinfo.h HAVE_SYSINFO)
|
||||
@@ -394,42 +395,42 @@ foreach(f ${function_checks})
|
||||
endforeach()
|
||||
|
||||
if(NOT HAVE_POLL_H OR NOT HAVE_SYS_POLL_H OR NOT HAVE_POLL)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/compat/poll)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/lib/compat/poll)
|
||||
add_compile_definitions(NO_POLL)
|
||||
list(APPEND compat_SOURCES compat/poll/poll.c)
|
||||
list(APPEND compat_SOURCES lib/compat/poll/poll.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_STRCASESTR)
|
||||
list(APPEND compat_SOURCES compat/strcasestr.c)
|
||||
list(APPEND compat_SOURCES lib/compat/strcasestr.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_STRLCPY)
|
||||
list(APPEND compat_SOURCES compat/strlcpy.c)
|
||||
list(APPEND compat_SOURCES lib/compat/strlcpy.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_STRTOUMAX)
|
||||
list(APPEND compat_SOURCES compat/strtoumax.c compat/strtoimax.c)
|
||||
list(APPEND compat_SOURCES lib/compat/strtoumax.c lib/compat/strtoimax.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_SETENV)
|
||||
list(APPEND compat_SOURCES compat/setenv.c)
|
||||
list(APPEND compat_SOURCES lib/compat/setenv.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_PREAD)
|
||||
list(APPEND compat_SOURCES compat/pread.c)
|
||||
list(APPEND compat_SOURCES lib/compat/pread.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_MEMMEM)
|
||||
list(APPEND compat_SOURCES compat/memmem.c)
|
||||
list(APPEND compat_SOURCES lib/compat/memmem.c)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
if(NOT HAVE_UNSETENV)
|
||||
list(APPEND compat_SOURCES compat/unsetenv.c)
|
||||
list(APPEND compat_SOURCES lib/compat/unsetenv.c)
|
||||
endif()
|
||||
|
||||
if(NOT HAVE_HSTRERROR)
|
||||
list(APPEND compat_SOURCES compat/hstrerror.c)
|
||||
list(APPEND compat_SOURCES lib/compat/hstrerror.c)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -486,7 +487,7 @@ int main(void)
|
||||
SNPRINTF_OK)
|
||||
if(NOT SNPRINTF_OK)
|
||||
add_compile_definitions(SNPRINTF_RETURNS_BOGUS)
|
||||
list(APPEND compat_SOURCES compat/snprintf.c)
|
||||
list(APPEND compat_SOURCES lib/compat/snprintf.c)
|
||||
endif()
|
||||
|
||||
check_c_source_runs("
|
||||
@@ -501,7 +502,7 @@ int main(void)
|
||||
FREAD_READS_DIRECTORIES_NO)
|
||||
if(NOT FREAD_READS_DIRECTORIES_NO)
|
||||
add_compile_definitions(FREAD_READS_DIRECTORIES)
|
||||
list(APPEND compat_SOURCES compat/fopen.c)
|
||||
list(APPEND compat_SOURCES lib/compat/fopen.c)
|
||||
endif()
|
||||
|
||||
check_c_source_compiles("
|
||||
@@ -516,8 +517,8 @@ int main(void)
|
||||
}"
|
||||
HAVE_REGEX)
|
||||
if(NOT HAVE_REGEX)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/compat/regex)
|
||||
list(APPEND compat_SOURCES compat/regex/regex.c )
|
||||
include_directories(${CMAKE_SOURCE_DIR}/lib/compat/regex)
|
||||
list(APPEND compat_SOURCES lib/compat/regex/regex.c )
|
||||
add_compile_definitions(NO_REGEX NO_MBSUPPORT GAWK)
|
||||
endif()
|
||||
|
||||
@@ -670,10 +671,10 @@ list(TRANSFORM compat_SOURCES PREPEND "${CMAKE_SOURCE_DIR}/")
|
||||
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/version-def.h"
|
||||
COMMAND "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
|
||||
"${CMAKE_SOURCE_DIR}"
|
||||
"${CMAKE_SOURCE_DIR}/version-def.h.in"
|
||||
"${CMAKE_SOURCE_DIR}/lib/version-def.h.in"
|
||||
"${CMAKE_BINARY_DIR}/version-def.h"
|
||||
DEPENDS "${SH_EXE}" "${CMAKE_SOURCE_DIR}/GIT-VERSION-GEN"
|
||||
"${CMAKE_SOURCE_DIR}/version-def.h.in"
|
||||
"${CMAKE_SOURCE_DIR}/lib/version-def.h.in"
|
||||
VERBATIM)
|
||||
list(APPEND libgit_SOURCES "${CMAKE_BINARY_DIR}/version-def.h")
|
||||
|
||||
@@ -732,7 +733,7 @@ if(WIN32)
|
||||
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
|
||||
add_executable(headless-git ${CMAKE_SOURCE_DIR}/lib/compat/win32/headless.c)
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
|
||||
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||
@@ -767,15 +768,15 @@ add_executable(scalar ${CMAKE_SOURCE_DIR}/scalar.c)
|
||||
target_link_libraries(scalar common-main)
|
||||
|
||||
if(CURL_FOUND)
|
||||
add_library(http_obj OBJECT ${CMAKE_SOURCE_DIR}/http.c)
|
||||
add_library(http_obj OBJECT ${CMAKE_SOURCE_DIR}/lib/http.c)
|
||||
|
||||
add_executable(git-imap-send ${CMAKE_SOURCE_DIR}/imap-send.c)
|
||||
target_link_libraries(git-imap-send http_obj common-main ${CURL_LIBRARIES})
|
||||
|
||||
add_executable(git-http-fetch ${CMAKE_SOURCE_DIR}/http-walker.c ${CMAKE_SOURCE_DIR}/http-fetch.c)
|
||||
add_executable(git-http-fetch ${CMAKE_SOURCE_DIR}/lib/http-walker.c ${CMAKE_SOURCE_DIR}/http-fetch.c)
|
||||
target_link_libraries(git-http-fetch http_obj common-main ${CURL_LIBRARIES})
|
||||
|
||||
add_executable(git-remote-http ${CMAKE_SOURCE_DIR}/http-walker.c ${CMAKE_SOURCE_DIR}/remote-curl.c)
|
||||
add_executable(git-remote-http ${CMAKE_SOURCE_DIR}/lib/http-walker.c ${CMAKE_SOURCE_DIR}/remote-curl.c)
|
||||
target_link_libraries(git-remote-http http_obj common-main ${CURL_LIBRARIES} )
|
||||
|
||||
if(EXPAT_FOUND)
|
||||
@@ -1201,7 +1202,7 @@ string(REPLACE "@USE_LIBPCRE2@" "" git_build_options "${git_build_options}")
|
||||
string(REPLACE "@WITH_BREAKING_CHANGES@" "" git_build_options "${git_build_options}")
|
||||
string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
|
||||
if(USE_VCPKG)
|
||||
string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
|
||||
string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../lib/compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
|
||||
endif()
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS ${git_build_options})
|
||||
|
||||
|
||||
@@ -21,4 +21,4 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
1 RT_MANIFEST "compat/win32/git.manifest"
|
||||
1 RT_MANIFEST "lib/compat/win32/git.manifest"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user