[llvm] 0ca19ef - Add AMDGPU MC unittests only when AMDGPU target is being built

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 23 09:11:24 PDT 2020


Author: Ram Nalamothu
Date: 2020-03-23T12:11:07-04:00
New Revision: 0ca19efe7b557cc833c0d665f76a3c0d49421f86

URL: https://github.com/llvm/llvm-project/commit/0ca19efe7b557cc833c0d665f76a3c0d49421f86
DIFF: https://github.com/llvm/llvm-project/commit/0ca19efe7b557cc833c0d665f76a3c0d49421f86.diff

LOG: Add AMDGPU MC unittests only when AMDGPU target is being built

Fixes the build failures introduced by 24698e526f619271705fe72bcaa928be9bc82484

Added: 
    

Modified: 
    llvm/unittests/MC/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/MC/CMakeLists.txt b/llvm/unittests/MC/CMakeLists.txt
index 05d6410bd8f7..48c06183ab99 100644
--- a/llvm/unittests/MC/CMakeLists.txt
+++ b/llvm/unittests/MC/CMakeLists.txt
@@ -1,3 +1,9 @@
+foreach(t ${LLVM_TARGETS_TO_BUILD})
+  if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${t})
+    add_subdirectory(${t})
+  endif()
+endforeach()
+
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   MC
@@ -13,4 +19,3 @@ add_llvm_unittest(MCTests
   TargetRegistry.cpp
   )
 
-add_subdirectory(AMDGPU)


        


More information about the llvm-commits mailing list