-
Notifications
You must be signed in to change notification settings - Fork 484
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
Modern cmake #104
base: master
Are you sure you want to change the base?
Modern cmake #104
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
) | ||
|
||
set(LOCAL_GENERATED_INCLUDE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/lib) | ||
install(EXPORT tcmallocTargets DESTINATION ${config_install_dir} NAMESPACE tcmalloc::) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install(EXPORT tcmallocTargets DESTINATION ${config_install_dir} NAMESPACE tcmalloc::) | |
install(EXPORT ${PROJECT_NAME}Targets DESTINATION ${config_install_dir} NAMESPACE tcmalloc::) |
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
|
||
install(FILES ${TCMALLOC_CC_LIB_HDRS} DESTINATION "include/tcmalloc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install(FILES ${TCMALLOC_CC_LIB_HDRS} DESTINATION "include/tcmalloc") | |
install(FILES ${TCMALLOC_CC_LIB_HDRS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tcmalloc") |
Hi, any plan to move forward with this PR? @ckennelly Thanks! |
I'm currently on holidays. I will get back to you guys in about two weeks... |
@craffael Appreciate the work to put this together! Could you please also add the doc to show how to use the CMake to build a shared lib of tcmalloc? |
@craffael still working on this PR? |
I have got it working and integrated the latest branch with cmake. What issue are you running into? Your build environment should meet the requirements in CMake and g++ or clang version. |
Any progress on this PR? I want to use the latest TcMalloc in Apache Doris apache/doris#9580. |
https://github.com/ObiWahn/tcmalloc-cmake If I look at your code, then I see that a lot needs to be done on my side :) |
Any hope of seeing this? Bazel is too big of a requirement for someone who just wants
|
@stonebrakert6 raises a good point--any project that wants to use this today MUST use Bazel, which is restrictive and sometimes not possible. Having a way to precompile this library and install it with lib and include folders would go a long way to making this easier to adopt in a project, especially if the project is also CMake based (as many MANY are). |
I don't know if you are interested in CMake support for TcMalloc. I recently had come up with this in order to use TcMalloc with the rest of my codebase and I thought you might be interested (?).
tcmalloc_cc_library
function which takes almost the same arguments asabsl_cc_library
alwayslink
from bazel. I solved this by using a recent feature of CMake 3.21 (https://cmake.org/cmake/help/v3.22/command/target_link_libraries.html#linking-object-libraries-via-target-objects). Because of this CMake 3.21 or higher is required.absl_DIR
.