Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[symengine] Fix find TCMALLOC #33582

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions ports/gperftools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,8 @@ if(WIN32) # TODO: MINGW, MSYS
target_include_directories(
libtcmalloc_minimal
PUBLIC
$<BUILD_INTERFACE:
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/src/windows
>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src/windows>
)

install(FILES ${deprecated_public_headers}
Expand All @@ -192,11 +190,18 @@ if(WIN32) # TODO: MINGW, MSYS
)

install(TARGETS libtcmalloc_minimal
EXPORT unofficial-libtcmalloc_minimal-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
EXPORT unofficial-libtcmalloc_minimal-targets
NAMESPACE unofficial::
FILE unofficial-libtcmalloc_minimal-config.cmake
DESTINATION share/unofficial-libtcmalloc_minimal
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC the guidelines say that port bar may install unofficial-bar-config.cmake with unofficial::bar::foo,
and so port gperftools may install unofficial-gperftools-config.cmake with unofficial::gperftools::libtcmalloc_minimal.

If gerftools is the right port to install and own this lib.


if(GPERFTOOLS_BUILD_TOOLS)
add_executable(addr2line-pdb src/windows/addr2line-pdb.c)
Expand Down
1 change: 1 addition & 0 deletions ports/gperftools/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(GLOB gperf_public_headers "${CURRENT_PACKAGES_DIR}/include/gperftools/*.h")
Expand Down
2 changes: 1 addition & 1 deletion ports/gperftools/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gperftools",
"version": "2.10",
"port-version": 1,
"port-version": 2,
"description": "A set of tools for performance profiling and memory checking",
"homepage": "https://github.com/gperftools/gperftools",
"supports": "!(arm & windows) & !uwp & !android",
Expand Down
13 changes: 13 additions & 0 deletions ports/symengine/fix-find-tcmalloc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ac911b..0490302 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -489,7 +489,7 @@ set(WITH_TCMALLOC no
CACHE BOOL "Build with TCMalloc linked")

if (WITH_TCMALLOC)
- find_package(TCMALLOC REQUIRED)
+ find_package(unofficial-libtcmalloc_minimal CONFIG REQUIRED)
set(LIBS ${LIBS} ${TCMALLOC_TARGETS})

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
2 changes: 2 additions & 0 deletions ports/symengine/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ vcpkg_from_github(
REF "v${VERSION}"
SHA512 076aac35428589c5b3524a46bd939a3a3a7da44b1c866b5f71487678b27b6e48b4da034029f1630881d7713a9252e905411a04b8016c9ec56a608b6de23365ac
HEAD_REF master
PATCHES
fix-find-tcmalloc.patch
)

vcpkg_check_features(
Expand Down
1 change: 1 addition & 0 deletions ports/symengine/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "symengine",
"version": "0.11.1",
"port-version": 1,
"description": "SymEngine is a fast symbolic manipulation library",
"homepage": "https://github.com/symengine/symengine",
"license": "BSD-3-Clause",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3122,7 +3122,7 @@
},
"gperftools": {
"baseline": "2.10",
"port-version": 1
"port-version": 2
},
"gpgme": {
"baseline": "1.23.2",
Expand Down Expand Up @@ -8426,7 +8426,7 @@
},
"symengine": {
"baseline": "0.11.1",
"port-version": 0
"port-version": 1
},
"systemc": {
"baseline": "2.3.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gperftools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6924034d669ccb4c88c2c185ec6580d401e72738",
"version": "2.10",
"port-version": 2
},
{
"git-tree": "ebb8ef920067346d4633cc78ee176f7ed9bc89d4",
"version": "2.10",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/symengine.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8734c0ea282624d7e681d8bafe1135132a107ba1",
"version": "0.11.1",
"port-version": 1
},
{
"git-tree": "2308025668dda013e8b55f395871ed7d73cd20d5",
"version": "0.11.1",
Expand Down
Loading