Commit Graph

8 Commits

Author SHA1 Message Date
Kefu Chai
8db629a14b cmake: import allocator libraries in a better way
* instead expose the paths, it'd better to expose a library target.
* remove HAVE_LIBJEMALLOC, as it not used anywhere.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-26 15:16:48 +08:00
Kefu Chai
599a9ef3ca cmake: should use the value of GPERFTOOLS_LIBRARIES as REQUIRED_VARS
otherwise it's always true, even if the libaries are not found. also
the cmake output will be wrong without this change:

without this change, it is:

-- Found gperftools: GPERFTOOLS_TCMALLOC_LIBRARY;GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY;GPERFTOOLS_PROFILER_LIBRARY (found version "2.5.93")

with this change, it would be:

-- Found gperftools: /tmp/gperf/lib/libtcmalloc.so (found version "2.5.93")

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-10-31 16:58:04 +08:00
Kefu Chai
caae3c4757 cmake: fix gperftools version detection
there is chance that its "patch" version is empty. in that case, do not
include it in its version string. otherwise, we will have something
like:

Found gperftools:
GPERFTOOLS_TCMALLOC_LIBRARY;GPERFTOOLS_TCMALLOC_MINIMAL_LIBRARY;GPERFTOOLS_PROFILER_LIBRARY
(found version "2.4.#define TC_VERSION_PATCH  """)

when running cmake

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-10-13 15:11:09 +08:00
Kefu Chai
58179f098b cmake: detect gperf-tools' version
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-19 13:46:50 +08:00
Kefu Chai
da8ce07a21 cmake: enable find_package(perftools) to check non-default dir
so it checks $ENV{GPERF_ROOT} first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-19 13:46:50 +08:00
Kefu Chai
6c12edbf9d cmake: cleanup Findgperftools.cmake
* remove Findtcmalloc.cmake, use Findgperftools.cmake instead.
* tcmalloc is packaged in gperftools-dev, so we can check them in a single
  place.
* fix the check of heap-profiler.h, we should enable the check as long
  as tcmalloc is enabled or profiler is enabled.
* only check gperftools headers in "include/gperftools", and do not
  "include/google" anymore. as we only support the distros which
  shipping recent gperftools-dev package with "include/gperftools".
  and "google/*.h" are deprecated.
* set ALLOC_LIBS with GPERFTOOLS_TCMALLOC_LIBRARY, so we can link
  against tcmalloc with full path.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-11 14:06:39 +08:00
Kefu Chai
07206f3173 cmake: cleanup Findgperftools.cmake
remove unused bits

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 16:17:42 +08:00
Daniel Gryniewicz
b02e0f9bfe CMake - fix libatomic_ops and gperftools checks
Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
2015-09-23 10:55:54 -04:00