xref: /llvm-project/compiler-rt/lib/ctx_profile/CMakeLists.txt (revision 9d15fc0060b584141674dddfedb06b0b58ad7aae)
1add_compiler_rt_component(ctx_profile)
2
3set(CTX_PROFILE_SOURCES
4  CtxInstrProfiling.cpp
5  )
6
7set(CTX_PROFILE_HEADERS
8  CtxInstrContextNode.h
9  CtxInstrProfiling.h
10  )
11
12include_directories(..)
13include_directories(../../include)
14
15# We don't use the C++ Standard Library here, so avoid including it by mistake.
16append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS)
17
18# __sanitizer_siginfo
19append_list_if(COMPILER_RT_HAS_WGNU_ANONYMOUS_STRUCT_FLAG -Wno-gnu-anonymous-struct EXTRA_FLAGS)
20
21if(COMPILER_RT_INCLUDE_TESTS)
22  add_subdirectory(tests)
23endif()
24
25add_compiler_rt_runtime(clang_rt.ctx_profile
26  STATIC
27  ARCHS ${CTX_PROFILE_SUPPORTED_ARCH}
28  OBJECT_LIBS RTSanitizerCommon RTSanitizerCommonLibc
29  CFLAGS ${EXTRA_FLAGS}
30  SOURCES ${CTX_PROFILE_SOURCES}
31  ADDITIONAL_HEADERS ${CTX_PROFILE_HEADERS}
32  PARENT_TARGET ctx_profile)
33