1if (NOT LIBIPT_INCLUDE_PATH)
2  message (FATAL_ERROR "libipt include path not provided")
3endif()
4
5if (NOT EXISTS "${LIBIPT_INCLUDE_PATH}")
6  message (FATAL_ERROR "invalid libipt include path provided")
7endif()
8include_directories(${LIBIPT_INCLUDE_PATH})
9
10find_library(LIBIPT_LIBRARY ipt PATHS ${LIBIPT_LIBRARY_PATH} REQUIRED)
11
12lldb_tablegen(TraceIntelPTCommandOptions.inc -gen-lldb-option-defs
13  SOURCE TraceIntelPTOptions.td
14  TARGET TraceIntelPTOptionsGen)
15
16add_lldb_library(lldbPluginTraceIntelPT PLUGIN
17  CommandObjectTraceStartIntelPT.cpp
18  DecodedThread.cpp
19  IntelPTDecoder.cpp
20  TraceIntelPT.cpp
21  TraceIntelPTSessionFileParser.cpp
22
23  LINK_LIBS
24    lldbCore
25    lldbSymbol
26    lldbTarget
27    ${LIBIPT_LIBRARY}
28  LINK_COMPONENTS
29    Support
30  )
31
32
33add_dependencies(lldbPluginTraceIntelPT TraceIntelPTOptionsGen)
34