summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-10-13 05:35:12 +0000
committerChris Bieneman <beanz@apple.com>2015-10-13 05:35:12 +0000
commit405342d075da81d372f454193e1c3f22ffe1e734 (patch)
tree4929f369eba1228573ee4f9fa0cbcf2e12f11cab /CMakeLists.txt
parent41ab11ccf0d228f0f442b6852caa196360b65d31 (diff)
[CMake] LLVM_PROFDATA_FILE only works if you're using clang, so we should error out if it is specified when not using clang.
Also updated the CMake docs. Based on post-commit review of r250108 from Sean Silvas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a2291c7822..d420e64228a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -594,7 +594,11 @@ set(LLVM_PROFDATA_FILE "" CACHE FILEPATH
"Profiling data file to use when compiling in order to improve runtime performance.")
if(LLVM_PROFDATA_FILE AND EXISTS ${LLVM_PROFDATA_FILE})
- add_definitions("-fprofile-instr-use=${LLVM_PROFDATA_FILE}")
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+ add_definitions("-fprofile-instr-use=${LLVM_PROFDATA_FILE}")
+ else()
+ message(FATAL_ERROR "LLVM_PROFDATA_FILE can only be specified when compiling with clang")
+ endif()
endif()
include(AddLLVM)