mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 13:53:02 +08:00
[jemalloc] Update to use vcpkg_from_github. Avoid adding config scripts that are not present in upstream. Rename DLLs to 'jemalloc' to match expectations elsewhere.
This commit is contained in:
parent
727be4b538
commit
7399ea0d6e
@ -1,4 +1,4 @@
|
||||
Source: jemalloc
|
||||
Version: 4.3.1
|
||||
Version: 4.3.1-1
|
||||
Description: jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support
|
||||
Build-Depends:
|
||||
|
@ -1,5 +1,5 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 06e83ef..17526b0 100644
|
||||
index 06e83ef..229e17a 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -57,6 +57,7 @@ option(enable-lazy-lock "Enable lazy locking (only lock when multi-threaded" OFF
|
||||
@ -10,7 +10,41 @@ index 06e83ef..17526b0 100644
|
||||
|
||||
set (PACKAGE_NAME "jemalloc")
|
||||
project (${PACKAGE_NAME} C)
|
||||
@@ -825,6 +826,17 @@ if(C_UTIL_INTEGRATION_DEFS)
|
||||
@@ -711,12 +712,8 @@ endif()
|
||||
|
||||
# The original library, delivery product
|
||||
set(LIBJEMALLOCLIB jemalloc${install_suffix})
|
||||
-add_library(${LIBJEMALLOCLIB} STATIC ${C_SRCS})
|
||||
-
|
||||
-# Now add shared library. Needed for integration tests
|
||||
-# and a benchmark
|
||||
-set(LIBJEMALLOCSO jemallocso${install_suffix})
|
||||
-add_library(${LIBJEMALLOCSO} SHARED ${C_SRCS})
|
||||
+set(LIBJEMALLOCSO ${LIBJEMALLOCLIB})
|
||||
+add_library(${LIBJEMALLOCLIB} ${C_SRCS})
|
||||
|
||||
if(WIN32)
|
||||
# May want to replace /d2Zi+ to /Zo
|
||||
@@ -745,8 +745,6 @@ if(WIN32)
|
||||
# either impport or export which is both wrong for a static library
|
||||
set_target_properties(${LIBJEMALLOCLIB}
|
||||
PROPERTIES
|
||||
- COMPILE_DEFINITIONS
|
||||
- "JEMALLOC_EXPORT="
|
||||
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG
|
||||
${PROJECT_BINARY_DIR}/Debug
|
||||
CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE
|
||||
@@ -754,6 +752,9 @@ if(WIN32)
|
||||
COMPILE_PDB_NAME
|
||||
${LIBJEMALLOCLIB}
|
||||
)
|
||||
+ if(NOT BUILD_SHARED_LIBS)
|
||||
+ target_compile_definitions(${LIBJEMALLOCLIB} "JEMALLOC_EXPORT=")
|
||||
+ endif()
|
||||
|
||||
endif()
|
||||
|
||||
@@ -825,6 +822,14 @@ if(C_UTIL_INTEGRATION_DEFS)
|
||||
"${C_UTIL_INTEGRATION_DEFS}")
|
||||
endif()
|
||||
|
||||
@ -18,17 +52,14 @@ index 06e83ef..17526b0 100644
|
||||
+ DESTINATION include/jemalloc)
|
||||
+
|
||||
+install(TARGETS ${LIBJEMALLOCSO}
|
||||
+ EXPORT JemallocTargets
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ LIBRARY DESTINATION lib
|
||||
+ ARCHIVE DESTINATION lib)
|
||||
+install(EXPORT JemallocTargets NAMESPACE jemalloc:: DESTINATION share/jemalloc)
|
||||
+
|
||||
+if (build-tests)
|
||||
##################################################################
|
||||
# Common source for Unit, Integration and stress test libraries
|
||||
set(C_TESTLIB_SRCS
|
||||
@@ -1028,4 +1040,4 @@ foreach(sourcefile ${TESTS_INTEGRATION})
|
||||
@@ -1028,4 +1033,4 @@ foreach(sourcefile ${TESTS_INTEGRATION})
|
||||
add_test(NAME ${exename} COMMAND ${exename})
|
||||
add_dependencies(check ${exename})
|
||||
endforeach(sourcefile ${TESTS_UNIT})
|
||||
|
@ -5,52 +5,30 @@ endif()
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
set(GIT_URL "https://github.com/jemalloc/jemalloc-cmake.git")
|
||||
set(GIT_REF "jemalloc-cmake.4.3.1")
|
||||
|
||||
if(NOT EXISTS "${DOWNLOADS}/jemalloc-cmake.git")
|
||||
message(STATUS "Cloning")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/jemalloc-cmake.git
|
||||
WORKING_DIRECTORY ${DOWNLOADS}
|
||||
LOGNAME clone
|
||||
)
|
||||
endif()
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)
|
||||
|
||||
if(NOT EXISTS "${SOURCE_PATH}/.git")
|
||||
message(STATUS "Adding worktree")
|
||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR})
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} worktree add -f --detach ${SOURCE_PATH} ${GIT_REF}
|
||||
WORKING_DIRECTORY ${DOWNLOADS}/jemalloc-cmake.git
|
||||
LOGNAME worktree
|
||||
)
|
||||
message(STATUS "Patching")
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch"
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/fix-utilities.patch"
|
||||
)
|
||||
endif()
|
||||
|
||||
# jemalloc uses git to get it version
|
||||
find_program(GIT NAMES git git.cmd)
|
||||
get_filename_component(GIT_EXE_PATH ${GIT} DIRECTORY)
|
||||
set(ENV{PATH} "${GIT_EXE_PATH};$ENV{PATH}")
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO jemalloc/jemalloc-cmake
|
||||
REF jemalloc-cmake.4.3.1
|
||||
SHA512 e94b62ec3a53acc0ab5acb247d7646bc172108e80f592bb41c2dd50d181cbbeb33d623adf28415ffc0a0e2de3818af2dfe4c04af75ac891ef5042bc5bb186886
|
||||
HEAD_REF master
|
||||
)
|
||||
vcpkg_apply_patches(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fix-cmakelists.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/fix-utilities.patch"
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS -DGIT_FOUND=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_fixup_cmake_targets()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
|
||||
# Handle copyright
|
||||
|
Loading…
Reference in New Issue
Block a user