summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/config-ix.cmake
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-04-05 07:35:28 +0000
committerClement Courbet <courbet@google.com>2018-04-05 07:35:28 +0000
commit47acf31e676cd13b4f2c0d250baee88afabf3073 (patch)
tree1a57fef8f5f223f65205a510981a359a0a379917 /llvm/cmake/config-ix.cmake
parent8afc99363bcfa1fcd12c8a45d73413696fb87dbd (diff)
downloadbcm5719-llvm-47acf31e676cd13b4f2c0d250baee88afabf3073.tar.gz
bcm5719-llvm-47acf31e676cd13b4f2c0d250baee88afabf3073.zip
[llvm-exegesis] Check for libpfm headers.
HAVE_LIBPFM is only defined if the libpfm headers are present. llvm-svn: 329261
Diffstat (limited to 'llvm/cmake/config-ix.cmake')
-rw-r--r--llvm/cmake/config-ix.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 2952eb77478..ff71ad32021 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/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)
OpenPOWER on IntegriCloud