[NFC][AMDGPU] Fix cmake when LLVM is a subproject
authorSebastian Neubauer <sebastian.neubauer@amd.com>
Wed, 22 Apr 2020 12:01:38 +0000 (14:01 +0200)
committerSebastian Neubauer <sebastian.neubauer@amd.com>
Wed, 22 Apr 2020 12:25:44 +0000 (14:25 +0200)
CMAKE_SOURCE_DIR is not the right directory if llvm is included in
another cmake project. PROJECT_SOURCE_DIR is always the same and should
be used instead.

llvm/unittests/Target/AMDGPU/CMakeLists.txt

index ba6b92f..7b4548a 100644 (file)
@@ -1,6 +1,6 @@
 include_directories(
-  ${CMAKE_SOURCE_DIR}/lib/Target/AMDGPU
-  ${CMAKE_BINARY_DIR}/lib/Target/AMDGPU
+  ${PROJECT_SOURCE_DIR}/lib/Target/AMDGPU
+  ${PROJECT_BINARY_DIR}/lib/Target/AMDGPU
   )
 
 set(LLVM_LINK_COMPONENTS