Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | add_custom_target(profile) |
Alexey Samsonov | c9de451 | 2013-03-19 09:17:35 +0000 | [diff] [blame] | 2 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 3 | set(PROFILE_SOURCES |
| 4 | GCDAProfiling.c |
| 5 | InstrProfiling.c |
| 6 | InstrProfilingBuffer.c |
| 7 | InstrProfilingFile.c |
| 8 | InstrProfilingPlatformDarwin.c |
| 9 | InstrProfilingPlatformOther.c |
| 10 | InstrProfilingRuntime.cc) |
Alexey Samsonov | c9de451 | 2013-03-19 09:17:35 +0000 | [diff] [blame] | 11 | |
Alexey Samsonov | 4df99d2 | 2013-03-25 14:20:11 +0000 | [diff] [blame] | 12 | if(APPLE) |
| 13 | add_compiler_rt_osx_static_runtime(clang_rt.profile_osx |
| 14 | ARCH ${PROFILE_SUPPORTED_ARCH} |
Chandler Carruth | e97262d | 2013-06-25 00:37:28 +0000 | [diff] [blame] | 15 | SOURCES ${PROFILE_SOURCES}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 16 | add_dependencies(profile clang_rt.profile_osx) |
Alexey Samsonov | 4df99d2 | 2013-03-25 14:20:11 +0000 | [diff] [blame] | 17 | else() |
Alexey Samsonov | c9de451 | 2013-03-19 09:17:35 +0000 | [diff] [blame] | 18 | foreach(arch ${PROFILE_SUPPORTED_ARCH}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 19 | add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 20 | CFLAGS -fPIC |
| 21 | SOURCES ${PROFILE_SOURCES}) |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 22 | add_dependencies(profile clang_rt.profile-${arch}) |
Alexey Samsonov | c9de451 | 2013-03-19 09:17:35 +0000 | [diff] [blame] | 23 | endforeach() |
| 24 | endif() |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 25 | |
| 26 | add_dependencies(compiler-rt profile) |