2020-05-16 04:59:18 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO gperftools/gperftools
|
|
|
|
REF fe62a0baab87ba3abca12f4a621532bf67c9a7d2
|
|
|
|
SHA512 fc0fb2c56d38046ac7bc2d36863dabf073b7aede7ce18916228d7b9f64cf33ae754708bff028353ada52bf4b79a7cd3e3334c1558a9ba64b06326b1537faf690
|
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2021-11-10 19:51:16 +01: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
|
|
|
|
override GPERFTOOLS_WIN32_OVERRIDE
|
|
|
|
tools GPERFTOOLS_BUILD_TOOLS
|
|
|
|
)
|
|
|
|
|
2021-11-10 19:51:16 +01:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-05-16 04:59:18 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
)
|
|
|
|
|
2021-11-10 19:51:16 +01:00
|
|
|
vcpkg_cmake_install()
|
2020-05-16 04:59:18 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-11-10 19:51:16 +01: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-10 19:51:16 +01: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()
|
|
|
|
|
|
|
|
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-10 19:51:16 +01: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-10 19:51:16 +01:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-05-16 04:59:18 +08:00
|
|
|
endif()
|
|
|
|
|
2021-11-10 19:51:16 +01:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|