[llvm] f9c9968 - cmake: Avoid using if(TARGET x AND TARGET y) (#159707)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 03:39:14 PDT 2025


Author: Matt Arsenault
Date: 2025-09-19T19:39:10+09:00
New Revision: f9c996856e84f64dd3c306916f238b713a4d777d

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

LOG: cmake: Avoid using if(TARGET x AND TARGET y) (#159707)

This appears to not work, and the documentation only has
examples with a single target checked at a time.

Added: 
    

Modified: 
    llvm/benchmarks/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/benchmarks/CMakeLists.txt b/llvm/benchmarks/CMakeLists.txt
index 1d9bf6b244935..57d49ed153749 100644
--- a/llvm/benchmarks/CMakeLists.txt
+++ b/llvm/benchmarks/CMakeLists.txt
@@ -14,13 +14,13 @@ add_benchmark(SandboxIRBench SandboxIRBench.cpp PARTIAL_SOURCES_INTENDED)
 add_benchmark(RuntimeLibcallsBench RuntimeLibcalls.cpp PARTIAL_SOURCES_INTENDED)
 
 if(NOT LLVM_TOOL_LLVM_DRIVER_BUILD)
-  # TODO: Check if the tools aer in LLVM_DISTRIBUTION_COMPONENTS with
+  # TODO: Check if the tools are in LLVM_DISTRIBUTION_COMPONENTS with
   # the driver build. Also support the driver build by invoking the
   # tools through llvm-driver
   get_host_tool_path(llvm-nm LLVM_NM llvm_nm_exe llvm_nm_target)
   get_host_tool_path(llc LLC llc_exe llc_target)
 
-  if(TARGET ${llc_target} AND TARGET ${llvm_nm_target})
+  if(${llc_exe} AND ${llvm_nm_exe})
     # Extract the list of symbols in a random utility as sample data.
     set(SYMBOL_TEST_DATA_FILE "sample_symbol_list.txt")
     set(SYMBOL_TEST_DATA_SOURCE_BINARY ${llc_exe})


        


More information about the llvm-commits mailing list