aboutsummaryrefslogtreecommitdiff
path: root/lib/profile/CMakeLists.txt
blob: 420d7660ee3666afba969a3f4ee3677c0c97e675 (plain) (blame)
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
add_custom_target(profile)

set(PROFILE_SOURCES
  GCDAProfiling.c
  InstrProfiling.c
  InstrProfilingBuffer.c
  InstrProfilingFile.c
  InstrProfilingPlatformDarwin.c
  InstrProfilingPlatformOther.c
  InstrProfilingRuntime.cc)

if(APPLE)
  add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
    ARCH ${PROFILE_SUPPORTED_ARCH}
    SOURCES ${PROFILE_SOURCES})
  add_dependencies(profile clang_rt.profile_osx)
else()
  foreach(arch ${PROFILE_SUPPORTED_ARCH})
    add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC
      CFLAGS -fPIC
      SOURCES ${PROFILE_SOURCES})
    add_dependencies(profile clang_rt.profile-${arch})
  endforeach()
endif()

add_dependencies(compiler-rt profile)