[llvm-commits] [llvm] r125968 - in /llvm/trunk: CMakeLists.txt cmake/modules/AddLLVM.cmake cmake/modules/CMakeLists.txt cmake/modules/LLVMConfig.cmake lib/Analysis/CMakeLists.txt lib/Bitcode/CMakeLists.txt lib/CMakeLists.txt lib/CodeGen/CMakeLists.txt lib/ExecutionEngine/CMakeLists.txt lib/MC/CMakeLists.txt lib/Target/CMakeLists.txt lib/Transforms/CMakeLists.txt tools/llvm-config/CMakeLists.txt

Oscar Fuentes ofv at wanadoo.es
Fri Feb 18 14:06:14 PST 2011


Author: ofv
Date: Fri Feb 18 16:06:14 2011
New Revision: 125968

URL: http://llvm.org/viewvc/llvm-project?rev=125968&view=rev
Log:
Move library stuff out of the toplevel CMakeLists.txt file.

Added:
    llvm/trunk/lib/Bitcode/CMakeLists.txt
    llvm/trunk/lib/CMakeLists.txt
    llvm/trunk/lib/Transforms/CMakeLists.txt
Modified:
    llvm/trunk/CMakeLists.txt
    llvm/trunk/cmake/modules/AddLLVM.cmake
    llvm/trunk/cmake/modules/CMakeLists.txt
    llvm/trunk/cmake/modules/LLVMConfig.cmake
    llvm/trunk/lib/Analysis/CMakeLists.txt
    llvm/trunk/lib/CodeGen/CMakeLists.txt
    llvm/trunk/lib/ExecutionEngine/CMakeLists.txt
    llvm/trunk/lib/MC/CMakeLists.txt
    llvm/trunk/lib/Target/CMakeLists.txt
    llvm/trunk/tools/llvm-config/CMakeLists.txt

Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -195,11 +195,9 @@
   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
 endif()
 
+# Put this before tblgen. Else we have a circular dependence.
 add_subdirectory(lib/Support)
 
-# Everything else depends on Support:
-set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
-
 set(LLVM_TABLEGEN "tblgen" CACHE
   STRING "Native TableGen executable. Saves building one when cross-compiling.")
 # Effective tblgen executable to be used:
@@ -214,25 +212,7 @@
 
 add_subdirectory(include/llvm)
 
-add_subdirectory(lib/VMCore)
-add_subdirectory(lib/CodeGen)
-add_subdirectory(lib/CodeGen/SelectionDAG)
-add_subdirectory(lib/CodeGen/AsmPrinter)
-add_subdirectory(lib/Bitcode/Reader)
-add_subdirectory(lib/Bitcode/Writer)
-add_subdirectory(lib/Transforms/Utils)
-add_subdirectory(lib/Transforms/Instrumentation)
-add_subdirectory(lib/Transforms/InstCombine)
-add_subdirectory(lib/Transforms/Scalar)
-add_subdirectory(lib/Transforms/IPO)
-add_subdirectory(lib/Transforms/Hello)
-add_subdirectory(lib/Linker)
-add_subdirectory(lib/Analysis)
-add_subdirectory(lib/Analysis/IPA)
-add_subdirectory(lib/MC)
-add_subdirectory(lib/MC/MCParser)
-add_subdirectory(lib/MC/MCDisassembler)
-add_subdirectory(lib/Object)
+add_subdirectory(lib)
 
 add_subdirectory(utils/FileCheck)
 add_subdirectory(utils/FileUpdate)
@@ -240,64 +220,6 @@
 add_subdirectory(utils/not)
 add_subdirectory(utils/llvm-lit)
 
-set(LLVM_ENUM_ASM_PRINTERS "")
-set(LLVM_ENUM_ASM_PARSERS "")
-set(LLVM_ENUM_DISASSEMBLERS "")
-foreach(t ${LLVM_TARGETS_TO_BUILD})
-  message(STATUS "Targeting ${t}")
-  add_subdirectory(lib/Target/${t})
-  add_subdirectory(lib/Target/${t}/TargetInfo)
-  set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} )
-  file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
-  if( asmp_file )
-    set(LLVM_ENUM_ASM_PRINTERS
-      "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
-  endif()
-  if( EXISTS ${td}/InstPrinter/CMakeLists.txt )
-    add_subdirectory(lib/Target/${t}/InstPrinter)
-  endif()
-  if( EXISTS ${td}/AsmParser/CMakeLists.txt )
-    add_subdirectory(lib/Target/${t}/AsmParser)
-    set(LLVM_ENUM_ASM_PARSERS
-      "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
-  endif()
-  if( EXISTS ${td}/Disassembler/CMakeLists.txt )
-    add_subdirectory(lib/Target/${t}/Disassembler)
-    set(LLVM_ENUM_DISASSEMBLERS
-      "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n")
-  endif()
-  if( EXISTS ${td}/Utils/CMakeLists.txt )
-    add_subdirectory(${td}/Utils)
-  endif()
-  set(CURRENT_LLVM_TARGET)
-endforeach(t)
-
-# Produce llvm/Config/AsmPrinters.def
-configure_file(
-  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
-  ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
-  )
-
-# Produce llvm/Config/AsmParsers.def
-configure_file(
-  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
-  ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def
-  )
-
-# Produce llvm/Config/Disassemblers.def
-configure_file(
-  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
-  ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def
-  )
-
-add_subdirectory(lib/ExecutionEngine)
-add_subdirectory(lib/ExecutionEngine/Interpreter)
-add_subdirectory(lib/ExecutionEngine/JIT)
-add_subdirectory(lib/ExecutionEngine/MCJIT)
-add_subdirectory(lib/Target)
-add_subdirectory(lib/AsmParser)
-add_subdirectory(lib/Archive)
-
 add_subdirectory(projects)
 
 option(LLVM_BUILD_TOOLS

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Feb 18 16:06:14 2011
@@ -4,8 +4,8 @@
 macro(add_llvm_library name)
   llvm_process_sources( ALL_FILES ${ARGN} )
   add_library( ${name} ${ALL_FILES} )
-  set( llvm_libs ${llvm_libs} ${name} PARENT_SCOPE)
-  set( llvm_lib_targets ${llvm_lib_targets} ${name} PARENT_SCOPE )
+  set_property( GLOBAL APPEND PROPERTY LLVM_LIBS ${name} )
+  set_property( GLOBAL APPEND PROPERTY LLVM_LIB_TARGETS ${name} )
   if( LLVM_COMMON_DEPENDS )
     add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
   endif( LLVM_COMMON_DEPENDS )

Modified: llvm/trunk/cmake/modules/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CMakeLists.txt (original)
+++ llvm/trunk/cmake/modules/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -1,5 +1,8 @@
 set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/share/llvm/cmake")
 
+get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
+get_property(llvm_lib_targets GLOBAL PROPERTY LLVM_LIB_TARGETS)
+
 configure_file(
   LLVM.cmake
   ${llvm_cmake_builddir}/LLVM.cmake

Modified: llvm/trunk/cmake/modules/LLVMConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVMConfig.cmake?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVMConfig.cmake (original)
+++ llvm/trunk/cmake/modules/LLVMConfig.cmake Fri Feb 18 16:06:14 2011
@@ -59,6 +59,7 @@
 
 function(explicit_map_components_to_libraries out_libs)
   set( link_components ${ARGN} )
+  get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
   string(TOUPPER "${llvm_libs}" capitalized_libs)
   # Translate symbolic component names to real libraries:
   foreach(c ${link_components})

Modified: llvm/trunk/lib/Analysis/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CMakeLists.txt (original)
+++ llvm/trunk/lib/Analysis/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -56,3 +56,5 @@
   TypeBasedAliasAnalysis.cpp
   ValueTracking.cpp
   )
+
+add_subdirectory(IPA)

Added: llvm/trunk/lib/Bitcode/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/CMakeLists.txt?rev=125968&view=auto
==============================================================================
--- llvm/trunk/lib/Bitcode/CMakeLists.txt (added)
+++ llvm/trunk/lib/Bitcode/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -0,0 +1,2 @@
+add_subdirectory(Reader)
+add_subdirectory(Writer)

Added: llvm/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CMakeLists.txt?rev=125968&view=auto
==============================================================================
--- llvm/trunk/lib/CMakeLists.txt (added)
+++ llvm/trunk/lib/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -0,0 +1,14 @@
+# `Support' library is added on the top-level CMakeLists.txt
+
+add_subdirectory(VMCore)
+add_subdirectory(CodeGen)
+add_subdirectory(Bitcode)
+add_subdirectory(Transforms)
+add_subdirectory(Linker)
+add_subdirectory(Analysis)
+add_subdirectory(MC)
+add_subdirectory(Object)
+add_subdirectory(ExecutionEngine)
+add_subdirectory(Target)
+add_subdirectory(AsmParser)
+add_subdirectory(Archive)

Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CMakeLists.txt (original)
+++ llvm/trunk/lib/CodeGen/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -94,3 +94,6 @@
   VirtRegMap.cpp
   VirtRegRewriter.cpp
   )
+
+add_subdirectory(SelectionDAG)
+add_subdirectory(AsmPrinter)

Modified: llvm/trunk/lib/ExecutionEngine/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/CMakeLists.txt (original)
+++ llvm/trunk/lib/ExecutionEngine/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -2,3 +2,7 @@
   ExecutionEngine.cpp
   ExecutionEngineBindings.cpp
   )
+
+add_subdirectory(Interpreter)
+add_subdirectory(JIT)
+add_subdirectory(MCJIT)

Modified: llvm/trunk/lib/MC/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/lib/MC/CMakeLists.txt (original)
+++ llvm/trunk/lib/MC/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -34,3 +34,6 @@
   WinCOFFObjectWriter.cpp
   TargetAsmBackend.cpp
   )
+
+add_subdirectory(MCParser)
+add_subdirectory(MCDisassembler)

Modified: llvm/trunk/lib/Target/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -15,3 +15,53 @@
   TargetRegisterInfo.cpp
   TargetSubtarget.cpp
   )
+
+set(LLVM_ENUM_ASM_PRINTERS "")
+set(LLVM_ENUM_ASM_PARSERS "")
+set(LLVM_ENUM_DISASSEMBLERS "")
+foreach(t ${LLVM_TARGETS_TO_BUILD})
+  message(STATUS "Targeting ${t}")
+  add_subdirectory(${t})
+  add_subdirectory(${t}/TargetInfo)
+  set( td ${LLVM_MAIN_SRC_DIR}/lib/Target/${t} )
+  file(GLOB asmp_file "${td}/*AsmPrinter.cpp")
+  if( asmp_file )
+    set(LLVM_ENUM_ASM_PRINTERS
+      "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
+  endif()
+  if( EXISTS ${td}/InstPrinter/CMakeLists.txt )
+    add_subdirectory(${t}/InstPrinter)
+  endif()
+  if( EXISTS ${td}/AsmParser/CMakeLists.txt )
+    add_subdirectory(${t}/AsmParser)
+    set(LLVM_ENUM_ASM_PARSERS
+      "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
+  endif()
+  if( EXISTS ${td}/Disassembler/CMakeLists.txt )
+    add_subdirectory(${t}/Disassembler)
+    set(LLVM_ENUM_DISASSEMBLERS
+      "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n")
+  endif()
+  if( EXISTS ${td}/Utils/CMakeLists.txt )
+    add_subdirectory(${td}/Utils)
+  endif()
+  set(CURRENT_LLVM_TARGET)
+endforeach(t)
+
+# Produce llvm/Config/AsmPrinters.def
+configure_file(
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
+  ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
+  )
+
+# Produce llvm/Config/AsmParsers.def
+configure_file(
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmParsers.def.in
+  ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def
+  )
+
+# Produce llvm/Config/Disassemblers.def
+configure_file(
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in
+  ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def
+  )

Added: llvm/trunk/lib/Transforms/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/CMakeLists.txt?rev=125968&view=auto
==============================================================================
--- llvm/trunk/lib/Transforms/CMakeLists.txt (added)
+++ llvm/trunk/lib/Transforms/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -0,0 +1,6 @@
+add_subdirectory(Utils)
+add_subdirectory(Instrumentation)
+add_subdirectory(InstCombine)
+add_subdirectory(Scalar)
+add_subdirectory(IPO)
+add_subdirectory(Hello)

Modified: llvm/trunk/tools/llvm-config/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-config/CMakeLists.txt?rev=125968&r1=125967&r2=125968&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-config/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-config/CMakeLists.txt Fri Feb 18 16:06:14 2011
@@ -70,6 +70,8 @@
   message(FATAL_ERROR "`nm' not found")
 endif()
 
+get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
+
 add_custom_command(OUTPUT ${LIBDEPS_TMP}
   COMMAND ${PERL_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/GenLibDeps.pl -flat ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} ${NM_PATH} > ${LIBDEPS_TMP}
   DEPENDS ${llvm_libs}
@@ -122,6 +124,7 @@
 add_custom_target(llvm-config.target ALL
   DEPENDS ${LLVM_CONFIG})
 
+get_property(llvm_lib_targets GLOBAL PROPERTY LLVM_LIB_TARGETS)
 add_dependencies(llvm-config.target ${llvm_lib_targets})
 
 # Make sure that llvm-config builds before the llvm tools, so we have





More information about the llvm-commits mailing list