[llvm-commits] [llvm] r78996 - in /llvm/trunk: CMakeLists.txt cmake/modules/AddLLVM.cmake
Oscar Fuentes
ofv at wanadoo.es
Thu Aug 13 22:17:24 PDT 2009
Author: ofv
Date: Fri Aug 14 00:17:24 2009
New Revision: 78996
URL: http://llvm.org/viewvc/llvm-project?rev=78996&view=rev
Log:
CMake: Builds main LLVM Target library before its sublibraries. This
way we ensure that tablegenned files exist before they are #include'd
by the LLVM Target sublibraries. Required for parallel builds.
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=78996&r1=78995&r2=78996&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Fri Aug 14 00:17:24 2009
@@ -266,6 +266,7 @@
set(LLVM_ENUM_ASM_PARSERS "")
foreach(t ${LLVM_TARGETS_TO_BUILD})
message(STATUS "Targeting ${t}")
+ set(CURRENT_LLVM_TARGET ${t})
add_subdirectory(lib/Target/${t})
add_subdirectory(lib/Target/${t}/TargetInfo)
if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
@@ -278,6 +279,7 @@
set(LLVM_ENUM_ASM_PARSERS
"${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n")
endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmParser/CMakeLists.txt )
+ set(CURRENT_LLVM_TARGET)
endforeach(t)
# Produce llvm/Config/AsmPrinters.def
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=78996&r1=78995&r2=78996&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Aug 14 00:17:24 2009
@@ -12,6 +12,13 @@
install(TARGETS ${name}
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ # The LLVM Target library shall be built before its sublibraries
+ # (asmprinter, etc) because those may use tablegenned files which
+ # generation is triggered by the main LLVM target library. Necessary
+ # for parallel builds:
+ if( CURRENT_LLVM_TARGET )
+ add_dependencies(${name} LLVM${CURRENT_LLVM_TARGET})
+ endif()
endmacro(add_llvm_library name)
More information about the llvm-commits
mailing list