1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[llvm-exegesis] Add a flag to disable libpfm even if present.

Summary: Fixes PR37053.

Reviewers: uabelho, gchatelet

Subscribers: mgorny, tschuett, llvm-commits

Differential Revision: https://reviews.llvm.org/D45436

llvm-svn: 329781
This commit is contained in:
Clement Courbet 2018-04-11 07:32:43 +00:00
parent ab1bf72e88
commit 84516bef77
5 changed files with 18 additions and 11 deletions

View File

@ -366,6 +366,8 @@ set(LLVM_ENABLE_LIBXML2 "ON" CACHE STRING "Use libxml2 if available. Can be ON,
option(LLVM_ENABLE_LIBEDIT "Use libedit if available." ON)
option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON)
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON)

View File

@ -90,14 +90,16 @@ if( NOT PURE_WINDOWS )
endif()
# Check for libpfm.
check_library_exists(pfm pfm_initialize "" HAVE_LIBPFM_INITIALIZE)
if(HAVE_LIBPFM_INITIALIZE)
if (LLVM_ENABLE_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()
endif()
if(HAVE_LIBPTHREAD)

View File

@ -374,6 +374,11 @@ LLVM-specific variables
**LLVM_USE_INTEL_JITEVENTS**:BOOL
Enable building support for Intel JIT Events API. Defaults to OFF.
**LLVM_ENABLE_LIBPFM**:BOOL
Enable building with libpfm to support hardware counter measurements in LLVM
tools.
Defaults to ON.
**LLVM_ENABLE_ZLIB**:BOOL
Enable building with zlib to support compression/uncompression in LLVM tools.
Defaults to ON.

View File

@ -10,7 +10,6 @@ add_llvm_tool(llvm-exegesis
add_subdirectory(lib)
target_link_libraries(llvm-exegesis PRIVATE LLVMExegesis)
if(HAVE_LIBPFM)
if(LLVM_ENABLE_LIBPFM AND HAVE_LIBPFM)
target_link_libraries(llvm-exegesis PRIVATE pfm)
endif()

View File

@ -22,7 +22,6 @@ add_llvm_unittest(LLVMExegesisTests
)
target_link_libraries(LLVMExegesisTests PRIVATE LLVMExegesis)
if(HAVE_LIBPFM)
if(LLVM_ENABLE_LIBPFM AND HAVE_LIBPFM)
target_link_libraries(LLVMExegesisTests PRIVATE pfm)
endif()