llvm-exegesis: Fix unittests include dirs when llvm is a part of another project
authorKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Thu, 5 Apr 2018 18:16:02 +0000 (18:16 +0000)
committerKonstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Thu, 5 Apr 2018 18:16:02 +0000 (18:16 +0000)
When llvm is a part of another project (i.e. opencl),
CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR are pointing to
the parent project, which lead to build failures.

Differential Revision: https://reviews.llvm.org/D45328

llvm-svn: 329325

llvm/unittests/tools/llvm-exegesis/CMakeLists.txt

index acc288a..bc376e0 100644 (file)
@@ -1,7 +1,7 @@
 include_directories(
-  ${CMAKE_SOURCE_DIR}/lib/Target/X86
-  ${CMAKE_BINARY_DIR}/lib/Target/X86
-  ${CMAKE_SOURCE_DIR}/tools/llvm-exegesis/lib
+  ${LLVM_MAIN_SRC_DIR}/lib/Target/X86
+  ${LLVM_BINARY_DIR}/lib/Target/X86
+  ${LLVM_MAIN_SRC_DIR}/tools/llvm-exegesis/lib
   )
 
 set(LLVM_LINK_COMPONENTS