add_custom_target(profile)

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

if(APPLE)
  add_compiler_rt_runtime(clang_rt.profile
    STATIC
    OS ${PROFILE_SUPPORTED_OS}
    ARCHS ${PROFILE_SUPPORTED_ARCH}
    SOURCES ${PROFILE_SOURCES}
    PARENT_TARGET profile)
else()
  add_compiler_rt_runtime(clang_rt.profile
    STATIC
    ARCHS ${PROFILE_SUPPORTED_ARCH}
    CFLAGS -fPIC
    SOURCES ${PROFILE_SOURCES}
    PARENT_TARGET profile)
endif()

add_dependencies(compiler-rt profile)

add_custom_target(profile)

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

include_directories("${LLVM_MAIN_INCLUDE_DIR}")

if(APPLE)
  add_compiler_rt_runtime(clang_rt.profile
    STATIC
    OS ${PROFILE_SUPPORTED_OS}
    ARCHS ${PROFILE_SUPPORTED_ARCH}
    SOURCES ${PROFILE_SOURCES}
    PARENT_TARGET profile)
else()
  add_compiler_rt_runtime(clang_rt.profile
    STATIC
    ARCHS ${PROFILE_SUPPORTED_ARCH}
    CFLAGS -fPIC
    SOURCES ${PROFILE_SOURCES}
    PARENT_TARGET profile)
endif()

add_dependencies(compiler-rt profile)

Add LLVM main include dir to profile runtime build
[PGO] Add LLVM main include dir to profile runtime build

Runtime code implicitly depends on the defintions and const
values defined in LLVM proper, but currently such dependency
is made implicitly by duplicating code across two dirs. As 
part of the PGO cleanup effort, there will be changes to share
common sources. This is a preparation patch to enable it (NFC).

Differential Revision: http://reviews.llvm.org/D14487


git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@252570 91177308-0d34-0410-b5e6-96231b3b80d8
