[llvm] bffd45b - [NFC][AMDGPU] Fix cmake when LLVM is a subproject
Sebastian Neubauer via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 22 05:25:54 PDT 2020
Author: Sebastian Neubauer
Date: 2020-04-22T14:25:44+02:00
New Revision: bffd45bab199cbe6021927ca4ab56e944eff5381
URL: https://github.com/llvm/llvm-project/commit/bffd45bab199cbe6021927ca4ab56e944eff5381
DIFF: https://github.com/llvm/llvm-project/commit/bffd45bab199cbe6021927ca4ab56e944eff5381.diff
LOG: [NFC][AMDGPU] Fix cmake when LLVM is a subproject
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.
Added:
Modified:
llvm/unittests/Target/AMDGPU/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/unittests/Target/AMDGPU/CMakeLists.txt b/llvm/unittests/Target/AMDGPU/CMakeLists.txt
index ba6b92f378a6..7b4548a0b678 100644
--- a/llvm/unittests/Target/AMDGPU/CMakeLists.txt
+++ b/llvm/unittests/Target/AMDGPU/CMakeLists.txt
@@ -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
More information about the llvm-commits
mailing list