diff options
author | Clement Courbet <courbet@google.com> | 2018-04-05 07:35:28 +0000 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2018-04-05 07:35:28 +0000 |
commit | 88fe9bccd85ce1d4d95bb2070fab4a971eeba034 (patch) | |
tree | 6d339686071c0ca54957405592acf2e2da5d8e6e /cmake | |
parent | 1fb4289a13272103ea3df9aea8fecf97344d9493 (diff) |
[llvm-exegesis] Check for libpfm headers.
HAVE_LIBPFM is only defined if the libpfm headers are present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/config-ix.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index 2952eb77478..ff71ad32021 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -87,7 +87,17 @@ if( NOT PURE_WINDOWS ) endif() check_library_exists(dl dlopen "" HAVE_LIBDL) check_library_exists(rt clock_gettime "" HAVE_LIBRT) - check_library_exists(pfm pfm_initialize "" HAVE_LIBPFM) +endif() + +# Check for libpfm. +check_library_exists(pfm pfm_initialize "" HAVE_LIBPFM_INITIALIZE) +if(HAVE_LIBPFM_INITIALIZE) + check_include_file(perfmon/perf_event.h HAVE_PERFMON_PERF_EVENT_H) + check_include_file(perfmon/pfmlib.h HAVE_PERFMON_PFMLIB_H) + check_include_file(perfmon/pfmlib_perf_event.h HAVE_PERFMON_PFMLIB_PERF_EVENT_H) + if(HAVE_PERFMON_PERF_EVENT_H AND HAVE_PERFMON_PFMLIB_H AND HAVE_PERFMON_PFMLIB_PERF_EVENT_H) + set(HAVE_LIBPFM 1) + endif() endif() if(HAVE_LIBPTHREAD) |