aboutsummaryrefslogtreecommitdiff
path: root/compiler-rt/lib/ctx_profile/CMakeLists.txt
blob: ce491fc7e8bf0936bcdfe24e3e03916b47f7bbb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
add_compiler_rt_component(ctx_profile)

set(CTX_PROFILE_SOURCES
  CtxInstrProfiling.cpp
  )

set(CTX_PROFILE_HEADERS
  CtxInstrContextNode.h
  CtxInstrProfiling.h
  )

include_directories(..)
include_directories(../../include)

# We don't use the C++ Standard Library here, so avoid including it by mistake.
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS)

# __sanitizer_siginfo
append_list_if(COMPILER_RT_HAS_WGNU_ANONYMOUS_STRUCT_FLAG -Wno-gnu-anonymous-struct EXTRA_FLAGS)

if(COMPILER_RT_INCLUDE_TESTS)
  add_subdirectory(tests)
endif()

add_compiler_rt_runtime(clang_rt.ctx_profile
  STATIC
  ARCHS ${CTX_PROFILE_SUPPORTED_ARCH}
  OBJECT_LIBS RTSanitizerCommon RTSanitizerCommonLibc
  CFLAGS ${EXTRA_FLAGS}
  SOURCES ${CTX_PROFILE_SOURCES}
  ADDITIONAL_HEADERS ${CTX_PROFILE_HEADERS}
  PARENT_TARGET ctx_profile)