[llvm] r279160 - [CMake] Create convenience targets for runtime projects

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 14:47:18 PDT 2016


Author: cbieneman
Date: Thu Aug 18 16:47:18 2016
New Revision: 279160

URL: http://llvm.org/viewvc/llvm-project?rev=279160&view=rev
Log:
[CMake] Create convenience targets for runtime projects

Each runtime project has a top-level target that is the name of the runtime (minus the "lib" prefix if applicable). This creates top-level targets mapping to runtime projects.

Modified:
    llvm/trunk/runtimes/CMakeLists.txt

Modified: llvm/trunk/runtimes/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/runtimes/CMakeLists.txt?rev=279160&r1=279159&r2=279160&view=diff
==============================================================================
--- llvm/trunk/runtimes/CMakeLists.txt (original)
+++ llvm/trunk/runtimes/CMakeLists.txt Thu Aug 18 16:47:18 2016
@@ -73,6 +73,12 @@ else() # if this is included from LLVM's
     string(REPLACE "-" "_" canon_name ${projName})
     string(TOUPPER ${canon_name} canon_name)
     list(APPEND prefixes ${canon_name})
+
+    string(FIND ${projName} "lib" LIB_IDX)
+    if(LIB_IDX EQUAL 0)
+      string(SUBSTRING ${projName} 3 -1 projName)
+    endif()
+    list(APPEND runtime_names ${projName})
   endforeach()
 
   if(runtimes)
@@ -85,6 +91,7 @@ else() # if this is included from LLVM's
                              # Builtins were built separately above
                              CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
                              PASSTHROUGH_PREFIXES ${prefixes}
+                             EXTRA_TARGETS ${runtime_names}
                              USE_TOOLCHAIN)
   endif()
 endif()




More information about the llvm-commits mailing list