diff options
author | Chris Bieneman <beanz@apple.com> | 2015-12-10 21:19:07 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-12-10 21:19:07 +0000 |
commit | dbdec57b56eec23756b42fe096d315aafb8ec495 (patch) | |
tree | c9944787d6f3f79b0852a3fa391133726b99dcb6 /llvm/cmake/modules | |
parent | 78a9db7ae0a6193e018d98528237766261c1a1fa (diff) | |
download | bcm5719-llvm-dbdec57b56eec23756b42fe096d315aafb8ec495.tar.gz bcm5719-llvm-dbdec57b56eec23756b42fe096d315aafb8ec495.zip |
[CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr-generate
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.
llvm-svn: 255298
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r-- | llvm/cmake/modules/HandleLLVMOptions.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 6c3109c4de7..f4ac6d7a73f 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -587,6 +587,14 @@ if(LLVM_ENABLE_EH AND NOT LLVM_ENABLE_RTTI) 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) |