mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-18 07:52:35 +00:00
CMake build system: support for parallel builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56453 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
242ebd145d
commit
1d8e4cfdb7
@ -97,6 +97,10 @@ include(AddPartiallyLinkedObject)
|
||||
|
||||
add_subdirectory(lib/Support)
|
||||
add_subdirectory(lib/System)
|
||||
|
||||
# Everything else depends on Support and System:
|
||||
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
|
||||
|
||||
add_subdirectory(utils/TableGen)
|
||||
|
||||
add_custom_command(OUTPUT ${llvm_builded_incs_dir}/Intrinsics.gen
|
||||
@ -107,6 +111,8 @@ add_custom_command(OUTPUT ${llvm_builded_incs_dir}/Intrinsics.gen
|
||||
add_custom_target(intrinsics_gen ALL
|
||||
DEPENDS ${llvm_builded_incs_dir}/Intrinsics.gen)
|
||||
|
||||
set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} intrinsics_gen )
|
||||
|
||||
add_subdirectory(lib/VMCore)
|
||||
add_subdirectory(lib/CodeGen)
|
||||
add_subdirectory(lib/CodeGen/SelectionDAG)
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
@ -5,3 +5,7 @@ add_llvm_library(LLVMX86AsmPrinter
|
||||
X86AsmPrinter.cpp
|
||||
X86IntelAsmPrinter.cpp
|
||||
)
|
||||
|
||||
target_name_of_partially_linked_object(LLVMX86CodeGen n)
|
||||
|
||||
add_dependencies(LLVMX86AsmPrinter ${n})
|
||||
|
@ -20,7 +20,6 @@ x86tgen(X86GenSubtarget.inc -gen-subtarget)
|
||||
|
||||
add_custom_target(X86Table_gen echo Tablegenning
|
||||
DEPENDS
|
||||
${llvm_builded_incs_dir}/Intrinsics.gen
|
||||
${CMAKE_CURRENT_BINARY_DIR}/X86GenRegisterInfo.h.inc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/X86GenRegisterNames.inc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/X86GenRegisterInfo.inc
|
||||
@ -34,6 +33,8 @@ add_custom_target(X86Table_gen echo Tablegenning
|
||||
${CMAKE_CURRENT_BINARY_DIR}/X86GenSubtarget.inc
|
||||
)
|
||||
|
||||
add_dependencies(X86Table_gen ${LLVM_COMMON_DEPENDS})
|
||||
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_partially_linked_object(LLVMX86CodeGen
|
||||
|
@ -69,7 +69,6 @@ set(LLVM_CONFIG_IN ${CMAKE_CURRENT_BINARY_DIR}/llvm-config.in)
|
||||
|
||||
add_custom_command(OUTPUT ${LIBDEPS_TMP}
|
||||
COMMAND ${PERL_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/GenLibDeps.pl -flat ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} > ${LIBDEPS_TMP}
|
||||
DEPENDS ${llvm_libs}
|
||||
COMMENT "Regenerating ${LIBDEPS_TMP}")
|
||||
|
||||
add_custom_command(OUTPUT ${LIBDEPS}
|
||||
@ -99,4 +98,6 @@ add_custom_command(OUTPUT ${LLVM_CONFIG}
|
||||
)
|
||||
|
||||
add_custom_target(llvm-config.target ALL
|
||||
DEPENDS ${LLVM_CONFIG})
|
||||
DEPENDS ${LLVM_CONFIG})
|
||||
|
||||
add_dependencies(llvm-config.target ${llvm_lib_targets})
|
||||
|
Loading…
x
Reference in New Issue
Block a user