2020-05-16 04:59:18 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO gperftools/gperftools
|
2023-08-08 00:02:52 +08:00
|
|
|
REF gperftools-2.10
|
|
|
|
SHA512 4400711723be9401f519d85b3b69c026e4715473cbed48ab0573df17abdf895fb971ee969875fe5127a2e8b9aba90d858285e50c8e012384c2c36d5a76b1f0c4
|
2020-05-16 04:59:18 +08:00
|
|
|
HEAD_REF master
|
2024-11-06 05:02:24 +08:00
|
|
|
PATCHES
|
|
|
|
libunwind.diff
|
2020-05-16 04:59:18 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2021-11-11 02:51:16 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
2020-05-16 04:59:18 +08:00
|
|
|
|
|
|
|
if(override IN_LIST FEATURES)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
message(STATUS "${PORT}[override] only supports static library linkage. Building static library.")
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY ONLY_STATIC_CRT)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2023-04-14 00:13:15 +08:00
|
|
|
FEATURES
|
|
|
|
override GPERFTOOLS_WIN32_OVERRIDE
|
|
|
|
tools GPERFTOOLS_BUILD_TOOLS
|
2020-05-16 04:59:18 +08:00
|
|
|
)
|
|
|
|
|
2021-11-11 02:51:16 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-05-16 04:59:18 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
)
|
|
|
|
|
2021-11-11 02:51:16 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-05-16 04:59:18 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-11-11 02:51:16 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2020-05-16 04:59:18 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
2021-11-11 02:51:16 +08:00
|
|
|
file(GLOB gperf_public_headers "${CURRENT_PACKAGES_DIR}/include/gperftools/*.h")
|
2020-05-16 04:59:18 +08:00
|
|
|
|
|
|
|
foreach(gperf_header ${gperf_public_headers})
|
|
|
|
vcpkg_replace_string(${gperf_header} "__declspec(dllimport)" "")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(tools IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES addr2line-pdb nm-pdb AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
set(BUILD_OPTS --enable-shared --disable-static)
|
|
|
|
else()
|
|
|
|
set(BUILD_OPTS --enable-static --disable-shared)
|
|
|
|
endif()
|
|
|
|
|
2024-11-06 05:02:24 +08:00
|
|
|
if(VCPKG_TARGET_IS_LINUX)
|
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
|
|
endif()
|
|
|
|
|
2020-05-16 04:59:18 +08:00
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
AUTOCONFIG
|
|
|
|
OPTIONS
|
|
|
|
${BUILD_OPTS}
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_make()
|
|
|
|
|
|
|
|
if(tools IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES pprof pprof-symbolize AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE
|
2021-11-11 02:51:16 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
2020-05-16 04:59:18 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# https://github.com/microsoft/vcpkg/pull/8750#issuecomment-625590773
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
2021-11-11 02:51:16 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-05-16 04:59:18 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-11 02:51:16 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|