vcpkg/ports/jemalloc/portfile.cmake
Alexander Neumann 2b35366a5d
[hpx] add some features, fix some bugs (#25059)
* refine hpx port

* v db

* add tcmalloc on unix

* refine comment

* v db

* remove hardcoded mpi dep

* v db

* portfile cleanup

* v db

* add pkgconf as a dep

* v db

* [snappy] remove debug suffix and add pc file

* hpx pass through _HOST_TRIPLET for pkgconf

* v db

* fix snappy in ffmpeg

* v db

* fix name clash of output names

* v db

* remove tcmalloc

* v db

* remove bin dir; seems empty on !windows

* v db

* b v

* v db

* baseline stuff

* fix jemalloc missing msvc_compat headers

* v db

* install usage for hpx

* v db

* Update versions/f-/ffmpeg.json

* revert v db

* bump ffmpeg

* v db

* remove jemalloc since I can force it thorugh the triplet any way.

* v db

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
2022-09-19 12:30:40 -07:00

57 lines
2.3 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jemalloc/jemalloc
REF 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c
SHA512 527bfbf5db9a5c2b7b04df4785b6ae9d445cff8cb17298bf3e550c88890d2bd7953642d8efaa417580610508279b527d3a3b9e227d17394fd2013c88cb7ae75a
HEAD_REF master
PATCHES
fix-configure-ac.patch
preprocessor.patch
)
if(VCPKG_TARGET_IS_WINDOWS)
set(opts "ac_cv_search_log=none required" "--without-private-namespace")
endif()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
NO_WRAPPERS
OPTIONS ${opts}
)
vcpkg_install_make()
if(VCPKG_TARGET_IS_WINDOWS)
file(COPY "${SOURCE_PATH}/include/msvc_compat/strings.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/jemalloc/msvc_compat")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/jemalloc/jemalloc.h" "<strings.h>" "\"msvc_compat/strings.h\"")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/bin/jemalloc.dll")
endif()
if(NOT VCPKG_BUILD_TYPE)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/jemalloc.dll")
endif()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
endif()
endif()
endif()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)