diff options
| author | JackBoosY <47264268+JackBoosY@users.noreply.github.com> | 2019-03-28 13:01:56 +0800 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-03-27 22:01:56 -0700 |
| commit | 493b76284dd0b075ac9486be6c9bd60af105bd3b (patch) | |
| tree | 5b0ec7dda3ff79ae01b49a3c70fe5ac535eb2b61 | |
| parent | c88974a2239b1de0facbf4cc096e0ad75c8e51a6 (diff) | |
| download | vcpkg-493b76284dd0b075ac9486be6c9bd60af105bd3b.tar.gz vcpkg-493b76284dd0b075ac9486be6c9bd60af105bd3b.zip | |
[jemalloc]Fix dll generated when generating static library (#5829)
* [jemalloc]Fix dll generated when generating static library
| -rw-r--r-- | ports/jemalloc/CONTROL | 2 | ||||
| -rw-r--r-- | ports/jemalloc/fix-static-build.patch | 25 | ||||
| -rw-r--r-- | ports/jemalloc/portfile.cmake | 15 |
3 files changed, 35 insertions, 7 deletions
diff --git a/ports/jemalloc/CONTROL b/ports/jemalloc/CONTROL index 5bdca6c43..7f6fa5ae2 100644 --- a/ports/jemalloc/CONTROL +++ b/ports/jemalloc/CONTROL @@ -1,4 +1,4 @@ Source: jemalloc -Version: 4.3.1-2 +Version: 4.3.1-3 Description: jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support Build-Depends: diff --git a/ports/jemalloc/fix-static-build.patch b/ports/jemalloc/fix-static-build.patch new file mode 100644 index 000000000..3ede809a8 --- /dev/null +++ b/ports/jemalloc/fix-static-build.patch @@ -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
diff --git a/ports/jemalloc/portfile.cmake b/ports/jemalloc/portfile.cmake index 527891666..3b99f21f5 100644 --- a/ports/jemalloc/portfile.cmake +++ b/ports/jemalloc/portfile.cmake @@ -11,19 +11,22 @@ vcpkg_from_github( 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" + 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 + OPTIONS -DGIT_FOUND=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -Dwithout-export=${BUILD_STATIC_LIBRARY} ) vcpkg_install_cmake() |
