This is the first step in supporting PGO data generation via CMake. I've marked the option as advanced and experimental until it is fleshed out further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255298
91177308-0d34-0410-b5e6-
96231b3b80d8
message(FATAL_ERROR "Exception handling requires RTTI. You must set LLVM_ENABLE_RTTI to ON")
endif()
+option(LLVM_BUILD_INSTRUMENTED "Build LLVM and tools with PGO instrumentation (experimental)" Off)
+mark_as_advanced(LLVM_BUILD_INSTRUMENTED)
+append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate"
+ CMAKE_CXX_FLAGS
+ CMAKE_C_FLAGS
+ CMAKE_EXE_LINKER_FLAGS
+ CMAKE_SHARED_LINKER_FLAGS)
+
# Plugin support
# FIXME: Make this configurable.
if(WIN32 OR CYGWIN)