blob: 420d7660ee3666afba969a3f4ee3677c0c97e675 [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001add_custom_target(profile)
Alexey Samsonovc9de4512013-03-19 09:17:35 +00002
Stephen Hines2d1fdb22014-05-28 23:58:16 -07003set(PROFILE_SOURCES
4 GCDAProfiling.c
5 InstrProfiling.c
6 InstrProfilingBuffer.c
7 InstrProfilingFile.c
8 InstrProfilingPlatformDarwin.c
9 InstrProfilingPlatformOther.c
10 InstrProfilingRuntime.cc)
Alexey Samsonovc9de4512013-03-19 09:17:35 +000011
Alexey Samsonov4df99d22013-03-25 14:20:11 +000012if(APPLE)
13 add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
14 ARCH ${PROFILE_SUPPORTED_ARCH}
Chandler Carruthe97262d2013-06-25 00:37:28 +000015 SOURCES ${PROFILE_SOURCES})
Stephen Hines2d1fdb22014-05-28 23:58:16 -070016 add_dependencies(profile clang_rt.profile_osx)
Alexey Samsonov4df99d22013-03-25 14:20:11 +000017else()
Alexey Samsonovc9de4512013-03-19 09:17:35 +000018 foreach(arch ${PROFILE_SUPPORTED_ARCH})
Stephen Hines2d1fdb22014-05-28 23:58:16 -070019 add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC
Stephen Hines2d1fdb22014-05-28 23:58:16 -070020 CFLAGS -fPIC
21 SOURCES ${PROFILE_SOURCES})
Stephen Hines6d186232014-11-26 17:56:19 -080022 add_dependencies(profile clang_rt.profile-${arch})
Alexey Samsonovc9de4512013-03-19 09:17:35 +000023 endforeach()
24endif()
Stephen Hines2d1fdb22014-05-28 23:58:16 -070025
26add_dependencies(compiler-rt profile)