early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,67 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
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
option(force_lazy_lock "Forcing lazy-lock to avoid allocator/threading bootstrap issues" OFF)
# install_prefix - installation directory prefix
# with-xslroot=<path> XSL stylesheet root path
+option(build-tests "Build tests" OFF)
set (PACKAGE_NAME "jemalloc")
project (${PACKAGE_NAME} C)
@@ -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()
+install(FILES include/jemalloc/jemalloc${install_suffix}.h
+ DESTINATION include/jemalloc)
+
+install(TARGETS ${LIBJEMALLOCSO}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+if (build-tests)
##################################################################
# Common source for Unit, Integration and stress test libraries
set(C_TESTLIB_SRCS
@@ -1028,4 +1033,4 @@ foreach(sourcefile ${TESTS_INTEGRATION})
add_test(NAME ${exename} COMMAND ${exename})
add_dependencies(check ${exename})
endforeach(sourcefile ${TESTS_UNIT})
-
+endif()

View File

@@ -0,0 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0b8959a..55e6a5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -826,10 +826,16 @@ endif()
install(FILES include/jemalloc/jemalloc${install_suffix}.h
DESTINATION include/jemalloc)
-install(TARGETS ${LIBJEMALLOCSO}
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+if (without-export)
+ install(TARGETS ${C_JETLIB}
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+else()
+ install(TARGETS ${LIBJEMALLOCSO}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+endif()
if (build-tests)
##################################################################
# Common source for Unit, Integration and stress test libraries

View File

@@ -0,0 +1,30 @@
diff --git a/Utilities.cmake b/Utilities.cmake
index 562e948..d2d3530 100644
--- a/Utilities.cmake
+++ b/Utilities.cmake
@@ -633,9 +633,11 @@ file(TO_NATIVE_PATH "${file_path}" ntv_file_path)
# This converts #undefs into #cmakedefines so configure_file can handle it
set(PS_CMD
"Get-Content \"${ntv_file_path}\" |
-ForEach {
+ForEach {
if($_ -match '^#undef[ \t]*[^ \t]*')
- { $_ -replace '^#undef[ \t]*([^ \t]*)','#cmakedefine $1 @$1@' } else {$_}}"
+ { $_ -replace '^#undef[ \t]*([^ \t]*)','#cmakedefine $1 @$1@' } else {$_}
+} |
+Set-Content \"${ntv_file_path}.cmake\""
)
if(EXISTS ${file_path})
@@ -646,9 +648,8 @@ if(EXISTS ${file_path})
# Convert autoconf .in into a cmake .in
execute_process(COMMAND powershell -Command "${PS_CMD}"
RESULT_VARIABLE error_level
- ERROR_VARIABLE error_output
- OUTPUT_FILE ${file_path}.cmake)
-
+ ERROR_VARIABLE error_output)
+
if(NOT ${error_level} EQUAL 0)
message(FATAL_ERROR "Powershell completed with ${error_level} : ${error_output}")
endif()

35
externals/vcpkg/ports/jemalloc/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,35 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jemalloc/jemalloc-cmake
REF jemalloc-cmake.4.3.1
SHA512 e94b62ec3a53acc0ab5acb247d7646bc172108e80f592bb41c2dd50d181cbbeb33d623adf28415ffc0a0e2de3818af2dfe4c04af75ac891ef5042bc5bb186886
HEAD_REF master
PATCHES
fix-cmakelists.patch
fix-utilities.patch
fix-static-build.patch
)
if (VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(BUILD_STATIC_LIBRARY OFF)
else()
set(BUILD_STATIC_LIBRARY ON)
endif()
vcpkg_configure_cmake(
DISABLE_PARALLEL_CONFIGURE
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS -DGIT_FOUND=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -Dwithout-export=${BUILD_STATIC_LIBRARY}
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/jemalloc)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/jemalloc/COPYING ${CURRENT_PACKAGES_DIR}/share/jemalloc/copyright)

7
externals/vcpkg/ports/jemalloc/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,7 @@
{
"name": "jemalloc",
"version-string": "4.3.1",
"port-version": 5,
"description": "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support",
"homepage": "https://github.com/jemalloc/jemalloc-cmake"
}