aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2008-09-22 18:21:51 +0000
committerOscar Fuentes <ofv@wanadoo.es>2008-09-22 18:21:51 +0000
commit1d8e4cfdb71d7055561a130a5844c5d093aa5ee8 (patch)
tree2752be1ff0b403aec9e208ef2e58e8678baa7d47 /cmake
parent242ebd145dea945364b4fa6ca6a187efe322036d (diff)
CMake build system: support for parallel builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/modules/AddLLVM.cmake4
-rwxr-xr-xcmake/modules/AddPartiallyLinkedObject.cmake16
2 files changed, 19 insertions, 1 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index c3641eacd2..fc917d324a 100755
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -3,6 +3,10 @@ include(LLVMConfig)
macro(add_llvm_library name)
add_library( ${name} ${ARGN} )
set( llvm_libs ${llvm_libs} ${name} PARENT_SCOPE)
+ set( llvm_lib_targets ${llvm_lib_targets} ${name} PARENT_SCOPE )
+ if( LLVM_COMMON_DEPENDS )
+ add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
+ endif( LLVM_COMMON_DEPENDS )
endmacro(add_llvm_library name)
diff --git a/cmake/modules/AddPartiallyLinkedObject.cmake b/cmake/modules/AddPartiallyLinkedObject.cmake
index a8a3d999e4..6968857db8 100755
--- a/cmake/modules/AddPartiallyLinkedObject.cmake
+++ b/cmake/modules/AddPartiallyLinkedObject.cmake
@@ -1,4 +1,13 @@
+macro(target_name_of_partially_linked_object lib var)
+ if( MSVC )
+ set(${var} ${lib})
+ else( MSVC )
+ set(${var} ${lib}_pll)
+ endif( MSVC )
+endmacro(target_name_of_partially_linked_object lib var)
+
+
macro(add_partially_linked_object lib)
if( MSVC )
add_llvm_library( ${lib} ${ARGN})
@@ -7,6 +16,9 @@ macro(add_partially_linked_object lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib)
add_library( ${lib} STATIC ${ARGN})
+ if( LLVM_COMMON_DEPENDS )
+ add_dependencies( ${lib} ${LLVM_COMMON_DEPENDS} )
+ endif( LLVM_COMMON_DEPENDS )
add_custom_command(OUTPUT ${pll}
COMMENT "Building ${lib}.o..."
DEPENDS ${lib}
@@ -15,7 +27,9 @@ macro(add_partially_linked_object lib)
COMMAND ld -r *${CMAKE_CXX_OUTPUT_EXTENSION} -o ${pll}
COMMAND rm -f *${CMAKE_CXX_OUTPUT_EXTENSION}
)
- add_custom_target(${lib}_pll ALL DEPENDS ${pll})
+ target_name_of_partially_linked_object(${lib} tnplo)
+ add_custom_target(${tnplo} ALL DEPENDS ${pll})
set( llvm_libs ${llvm_libs} ${pll} PARENT_SCOPE)
+ set( llvm_lib_targets ${llvm_lib_targets} ${tnplo} PARENT_SCOPE )
endif( MSVC )
endmacro(add_partially_linked_object lib)