Merge pull request #6999 from libgit2/ethomson/remove_weird_bundled_deps

Remove strange bundled libssh2 and chromium
This commit is contained in:
Edward Thomson
2025-01-07 16:10:13 +00:00
committed by GitHub
3 changed files with 0 additions and 114 deletions

View File

@@ -74,10 +74,6 @@ if(MSVC)
# This option must match the settings used in your program, in particular if you
# are linking statically
option(STATIC_CRT "Link the static CRT libraries" ON)
# If you want to embed a copy of libssh2 into libgit2, pass a
# path to libssh2
option(EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF)
endif()
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)

View File

@@ -27,15 +27,6 @@ elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
set(GIT_SSH_LIBSSH2_MEMORY_CREDENTIALS 1)
endif()
if(WIN32 AND EMBED_SSH_PATH)
file(GLOB SSH_SRC "${EMBED_SSH_PATH}/src/*.c")
list(SORT SSH_SRC)
list(APPEND LIBGIT2_DEPENDENCY_OBJECTS ${SSH_SRC})
list(APPEND LIBGIT2_DEPENDENCY_INCLUDES "${EMBED_SSH_PATH}/include")
file(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
endif()
set(GIT_SSH 1)
set(GIT_SSH_LIBSSH2 1)
add_feature_info(SSH ON "using libssh2")

View File

@@ -1,101 +0,0 @@
# CMake build script for the bundled Chromium zlib implementation. So far, it
# is only supported for x86_64 processors with CLMUL, SSE3, SSE4.2.
#
# TODO: The Chromium build file (in deps/chromium-zlib/zlib/BUILD.gn) supports
# more platforms (like ARM with NEON), more can be enabled as needed.
cmake_minimum_required(VERSION 3.11)
include(FetchContent)
include(FindGit)
# Ensure that the git binary is present to download the sources.
find_package(Git)
if(NOT Git_FOUND)
message(FATAL_ERROR "git is required to download the Chromium zlib sources")
endif()
fetchcontent_populate(chromium_zlib_src
GIT_REPOSITORY https://chromium.googlesource.com/chromium/src/third_party/zlib.git
GIT_TAG 2c183c9f93a328bfb3121284da13cf89a0f7e64a
QUIET
)
# The Chromium build globally disables some warnings.
disable_warnings(implicit-fallthrough)
disable_warnings(unused-function)
disable_warnings(unused-parameter)
disable_warnings(sign-compare)
disable_warnings(declaration-after-statement)
disable_warnings(missing-declarations)
# -O3 is also set by the Chromium configuration and has been deemed safe enough
# for them.
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
# Common definitions.
add_definitions(
-DSTDC
-DNO_GZIP
-DZLIB_IMPLEMENTATION
)
list(APPEND SRC_ZLIB
"${chromium_zlib_src_SOURCE_DIR}/adler32.c"
"${chromium_zlib_src_SOURCE_DIR}/chromeconf.h"
"${chromium_zlib_src_SOURCE_DIR}/compress.c"
"${chromium_zlib_src_SOURCE_DIR}/contrib/optimizations/insert_string.h"
"${chromium_zlib_src_SOURCE_DIR}/cpu_features.c"
"${chromium_zlib_src_SOURCE_DIR}/cpu_features.h"
"${chromium_zlib_src_SOURCE_DIR}/crc32.c"
"${chromium_zlib_src_SOURCE_DIR}/crc32.h"
"${chromium_zlib_src_SOURCE_DIR}/deflate.c"
"${chromium_zlib_src_SOURCE_DIR}/deflate.h"
"${chromium_zlib_src_SOURCE_DIR}/gzclose.c"
"${chromium_zlib_src_SOURCE_DIR}/gzguts.h"
"${chromium_zlib_src_SOURCE_DIR}/gzlib.c"
"${chromium_zlib_src_SOURCE_DIR}/gzread.c"
"${chromium_zlib_src_SOURCE_DIR}/gzwrite.c"
"${chromium_zlib_src_SOURCE_DIR}/infback.c"
"${chromium_zlib_src_SOURCE_DIR}/inffast.c"
"${chromium_zlib_src_SOURCE_DIR}/inffast.h"
"${chromium_zlib_src_SOURCE_DIR}/inffixed.h"
"${chromium_zlib_src_SOURCE_DIR}/inflate.h"
"${chromium_zlib_src_SOURCE_DIR}/inftrees.c"
"${chromium_zlib_src_SOURCE_DIR}/inftrees.h"
"${chromium_zlib_src_SOURCE_DIR}/trees.c"
"${chromium_zlib_src_SOURCE_DIR}/trees.h"
"${chromium_zlib_src_SOURCE_DIR}/uncompr.c"
"${chromium_zlib_src_SOURCE_DIR}/zconf.h"
"${chromium_zlib_src_SOURCE_DIR}/zlib.h"
"${chromium_zlib_src_SOURCE_DIR}/zutil.c"
"${chromium_zlib_src_SOURCE_DIR}/zutil.h"
)
# x86_64-specific optimizations
string(APPEND CMAKE_C_FLAGS " -mssse3 -msse4.2 -mpclmul")
add_definitions(
-DCHROMIUM_ZLIB_NO_CHROMECONF
-DX86_NOT_WINDOWS
-DADLER32_SIMD_SSSE3
-DCRC32_SIMD_SSE42_PCLMUL
-DDEFLATE_FILL_WINDOW_SSE2
-DINFLATE_CHUNK_READ_64LE
-DINFLATE_CHUNK_SIMD_SSE2
)
list(APPEND SRC_ZLIB
"${chromium_zlib_src_SOURCE_DIR}/adler32_simd.c"
"${chromium_zlib_src_SOURCE_DIR}/adler32_simd.h"
"${chromium_zlib_src_SOURCE_DIR}/contrib/optimizations/chunkcopy.h"
"${chromium_zlib_src_SOURCE_DIR}/contrib/optimizations/inffast_chunk.c"
"${chromium_zlib_src_SOURCE_DIR}/contrib/optimizations/inffast_chunk.h"
"${chromium_zlib_src_SOURCE_DIR}/contrib/optimizations/inflate.c"
"${chromium_zlib_src_SOURCE_DIR}/crc32_simd.c"
"${chromium_zlib_src_SOURCE_DIR}/crc32_simd.h"
"${chromium_zlib_src_SOURCE_DIR}/crc_folding.c"
"${chromium_zlib_src_SOURCE_DIR}/fill_window_sse.c"
)
list(SORT SRC_ZLIB)
include_directories("${chromium_zlib_src_SOURCE_DIR}")
add_library(chromium_zlib OBJECT ${SRC_ZLIB})