Home | History | Annotate | Download | only in profile
      1 add_custom_target(profile)
      2 
      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)
     11 
     12 if(APPLE)
     13   add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
     14     ARCH ${PROFILE_SUPPORTED_ARCH}
     15     SOURCES ${PROFILE_SOURCES})
     16   add_dependencies(profile clang_rt.profile_osx)
     17 else()
     18   foreach(arch ${PROFILE_SUPPORTED_ARCH})
     19     add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC
     20       SOURCES ${PROFILE_SOURCES})
     21     add_dependencies(profile clang_rt.profile-${arch})
     22 
     23     add_compiler_rt_runtime(clang_rt.profile-pic-${arch} ${arch} STATIC
     24       CFLAGS -fPIC
     25       SOURCES ${PROFILE_SOURCES})
     26     add_dependencies(profile clang_rt.profile-pic-${arch})
     27   endforeach()
     28 endif()
     29 
     30 add_dependencies(compiler-rt profile)
     31