[llvm] [llvm-exegesis] Only link/initialize supported targets (NFC) (PR #95421)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 05:52:36 PDT 2024


================
@@ -1,16 +1,23 @@
+# Has side effect of defining LLVM_EXEGESIS_TARGETS
+add_subdirectory(lib)
+
 set(LLVM_LINK_COMPONENTS
-  AllTargetsAsmParsers
-  AllTargetsCodeGens
-  AllTargetsDescs
-  AllTargetsDisassemblers
-  AllTargetsInfos
   CodeGenTypes
   MC
   MCParser
   Support
   TargetParser
   )
 
+foreach(t ${LLVM_EXEGESIS_TARGETS})
+  string(STRIP ${t} t)
+  list(APPEND LLVM_LINK_COMPONTENTS "LLVM${t}AsmParser")
+  list(APPEND LLVM_LINK_COMPONTENTS "LLVM${t}CodeGen")
+  list(APPEND LLVM_LINK_COMPONTENTS "LLVM${t}Desc")
+  list(APPEND LLVM_LINK_COMPONTENTS "LLVM${t}Disassembler")
+  list(APPEND LLVM_LINK_COMPONTENTS "LLVM${t}Info")
----------------
nikic wrote:

Thanks for pointing that out. I've pushed https://github.com/llvm/llvm-project/commit/8ab3f8ae0d39048e4bc1198514049813c6765fb6, let's see if that fixes the buildbots.

I think the reason this worked in my testing is that the exegesis targets also depend on the umbrella codegen targets, so it works out okay if BUILD_SHARED_LIBS is not enabled.

https://github.com/llvm/llvm-project/pull/95421


More information about the llvm-commits mailing list