2014-02-18 17:33:45 +08:00
|
|
|
add_custom_target(profile)
|
|
|
|
|
2014-04-23 02:49:32 +08:00
|
|
|
set(PROFILE_SOURCES
|
|
|
|
GCDAProfiling.c
|
|
|
|
InstrProfiling.c
|
|
|
|
InstrProfilingBuffer.c
|
|
|
|
InstrProfilingFile.c
|
|
|
|
InstrProfilingPlatformDarwin.c
|
|
|
|
InstrProfilingPlatformOther.c
|
|
|
|
InstrProfilingRuntime.cc)
|
2014-03-20 11:57:33 +08:00
|
|
|
|
2014-04-23 02:49:32 +08:00
|
|
|
if(APPLE)
|
2013-03-25 22:20:11 +08:00
|
|
|
add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
|
2015-06-19 11:39:24 +08:00
|
|
|
ARCHS ${PROFILE_SUPPORTED_ARCH}
|
2013-06-25 08:37:28 +08:00
|
|
|
SOURCES ${PROFILE_SOURCES})
|
2014-02-18 17:33:45 +08:00
|
|
|
add_dependencies(profile clang_rt.profile_osx)
|
2013-03-25 22:20:11 +08:00
|
|
|
else()
|
2013-03-19 17:17:35 +08:00
|
|
|
foreach(arch ${PROFILE_SUPPORTED_ARCH})
|
2014-03-31 21:45:36 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC
|
2014-05-16 12:07:09 +08:00
|
|
|
CFLAGS -fPIC
|
|
|
|
SOURCES ${PROFILE_SOURCES})
|
2014-11-14 08:16:26 +08:00
|
|
|
add_dependencies(profile clang_rt.profile-${arch})
|
2013-03-19 17:17:35 +08:00
|
|
|
endforeach()
|
|
|
|
endif()
|
2014-02-18 17:33:45 +08:00
|
|
|
|
|
|
|
add_dependencies(compiler-rt profile)
|