[libclc] 9d11128 - [libclc] Improve clarity of CMake foreach. NFC.

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 08:50:27 PDT 2024


Author: Fraser Cormack
Date: 2024-04-16T16:50:14+01:00
New Revision: 9d111286322ec99b32467eef3aeec6b588c49f18

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

LOG: [libclc] Improve clarity of CMake foreach. NFC.

Should be a bit easier to read.

Added: 
    

Modified: 
    libclc/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index ed2764847e709e..f605c3bbbe9dce 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -50,7 +50,7 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI
   endif()
 
   # Import required tools as targets
-  foreach( tool clang llvm-as llvm-link opt )
+  foreach( tool IN ITEMS clang llvm-as llvm-link opt )
     find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
     add_executable( libclc::${tool} IMPORTED GLOBAL )
     set_target_properties( libclc::${tool} PROPERTIES IMPORTED_LOCATION ${LLVM_TOOL_${tool}} )
@@ -68,7 +68,7 @@ else()
     message(FATAL_ERROR "Clang is not enabled, but is required to build libclc in-tree")
   endif()
 
-  foreach( tool clang llvm-as llvm-link opt )
+  foreach( tool IN ITEMS clang llvm-as llvm-link opt )
     add_executable(libclc::${tool} ALIAS ${tool})
   endforeach()
 endif()
@@ -181,7 +181,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libclc.pc DESTINATION "${CMAKE_INSTAL
 install( DIRECTORY generic/include/clc DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" )
 
 if( ENABLE_RUNTIME_SUBNORMAL )
-  foreach( file subnormal_use_default subnormal_disable )
+  foreach( file IN ITEMS subnormal_use_default subnormal_disable )
     link_bc(
        TARGET ${file}
        INPUTS ${PROJECT_SOURCE_DIR}/generic/lib/${file}.ll


        


More information about the cfe-commits mailing list