[RISCV] Add addu.w and slliu.w test that uses getelementptr with zero extended indices.
[lldb.git] / lldb / tools / intel-features / CMakeLists.txt
1 # Flags to control each individual feature
2 option(LLDB_BUILD_INTEL_MPX "Enable Building of Intel(R) Memory Protection Extensions" ON)
3 option(LLDB_BUILD_INTEL_PT "Enable Building of Intel(R) Processor Trace Tool" OFF)
4
5 # Return if all features are OFF
6 if (NOT LLDB_BUILD_INTEL_MPX AND NOT LLDB_BUILD_INTEL_PT)
7   return()
8 endif()
9
10 LIST (APPEND FEATURE_LIBS "")
11
12 # Add feature specific subdirectories based on flags
13 if (LLDB_BUILD_INTEL_MPX AND CMAKE_SYSTEM_NAME MATCHES "Linux")
14   add_subdirectory(intel-mpx)
15   LIST (APPEND FEATURE_LIBS ${FEATURE_LIBS} lldbIntelMPX)
16   SET (CLI_WRAPPER_PREPROCESSORS "${CLI_WRAPPER_PREPROCESSORS} -DBUILD_INTEL_MPX")
17 endif()
18
19 if (LLDB_BUILD_INTEL_PT)
20   add_subdirectory(intel-pt)
21   LIST (APPEND FEATURE_LIBS ${FEATURE_LIBS} lldbIntelPT)
22   SET (CLI_WRAPPER_PREPROCESSORS "${CLI_WRAPPER_PREPROCESSORS} -DBUILD_INTEL_PT")
23 endif()
24
25 # Add python wrapper if python not disabled
26 if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
27   list(APPEND FEATURE_LIBS ${FEATURE_LIBS} ${Python3_LIBRARIES})
28   set(LLDB_INTEL_FEATURES_PYTHON_WRAP
29      ${LLDB_BINARY_DIR}/tools/intel-features/scripts/IntelFeaturesPythonWrap.cpp)
30   set_source_files_properties(${LLDB_INTEL_FEATURES_PYTHON_WRAP}
31                               PROPERTIES GENERATED 1)
32
33   if (CLANG_CL)
34     set_source_files_properties(${LLDB_INTEL_FEATURES_PYTHON_WRAP}
35                                  PROPERTIES COMPILE_FLAGS -Wno-unused-function)
36   endif()
37
38   if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
39       NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
40     set_property(SOURCE ${LLDB_INTEL_FEATURES_PYTHON_WRAP}
41                  APPEND_STRING PROPERTY COMPILE_FLAGS
42                  " -Wno-sequence-point -Wno-cast-qual")
43   endif ()
44   add_subdirectory(scripts)
45 endif()
46
47 if (NOT CLI_WRAPPER_PREPROCESSORS)
48   return()
49 endif()
50
51 set_source_files_properties(cli-wrapper.cpp PROPERTIES
52                             COMPILE_FLAGS ${CLI_WRAPPER_PREPROCESSORS})
53
54 add_lldb_library(lldbIntelFeatures SHARED
55   cli-wrapper.cpp
56   ${LLDB_INTEL_FEATURES_PYTHON_WRAP}
57
58   LINK_LIBS
59     ${FEATURE_LIBS}
60   )
61
62 # Add link dependencies for python wrapper
63 if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
64   add_dependencies(lldbIntelFeatures intel-features-swig_wrapper)
65 endif()
66
67 install(TARGETS lldbIntelFeatures
68   LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})