llvm.org GIT mirror llvm / 1d8e4cf
CMake build system: support for parallel builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56453 91177308-0d34-0410-b5e6-96231b3b80d8 Oscar Fuentes 10 years ago
6 changed file(s) with 34 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
9696
9797 add_subdirectory(lib/Support)
9898 add_subdirectory(lib/System)
99
100 # Everything else depends on Support and System:
101 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
102
99103 add_subdirectory(utils/TableGen)
100104
101105 add_custom_command(OUTPUT ${llvm_builded_incs_dir}/Intrinsics.gen
105109
106110 add_custom_target(intrinsics_gen ALL
107111 DEPENDS ${llvm_builded_incs_dir}/Intrinsics.gen)
112
113 set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} intrinsics_gen )
108114
109115 add_subdirectory(lib/VMCore)
110116 add_subdirectory(lib/CodeGen)
22 macro(add_llvm_library name)
33 add_library( ${name} ${ARGN} )
44 set( llvm_libs ${llvm_libs} ${name} PARENT_SCOPE)
5 set( llvm_lib_targets ${llvm_lib_targets} ${name} PARENT_SCOPE )
6 if( LLVM_COMMON_DEPENDS )
7 add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
8 endif( LLVM_COMMON_DEPENDS )
59 endmacro(add_llvm_library name)
610
711
0
1 macro(target_name_of_partially_linked_object lib var)
2 if( MSVC )
3 set(${var} ${lib})
4 else( MSVC )
5 set(${var} ${lib}_pll)
6 endif( MSVC )
7 endmacro(target_name_of_partially_linked_object lib var)
8
9
110 macro(add_partially_linked_object lib)
211 if( MSVC )
615 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib)
716 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib)
817 add_library( ${lib} STATIC ${ARGN})
18 if( LLVM_COMMON_DEPENDS )
19 add_dependencies( ${lib} ${LLVM_COMMON_DEPENDS} )
20 endif( LLVM_COMMON_DEPENDS )
921 add_custom_command(OUTPUT ${pll}
1022 COMMENT "Building ${lib}.o..."
1123 DEPENDS ${lib}
1426 COMMAND ld -r *${CMAKE_CXX_OUTPUT_EXTENSION} -o ${pll}
1527 COMMAND rm -f *${CMAKE_CXX_OUTPUT_EXTENSION}
1628 )
17 add_custom_target(${lib}_pll ALL DEPENDS ${pll})
29 target_name_of_partially_linked_object(${lib} tnplo)
30 add_custom_target(${tnplo} ALL DEPENDS ${pll})
1831 set( llvm_libs ${llvm_libs} ${pll} PARENT_SCOPE)
32 set( llvm_lib_targets ${llvm_lib_targets} ${tnplo} PARENT_SCOPE )
1933 endif( MSVC )
2034 endmacro(add_partially_linked_object lib)
44 X86AsmPrinter.cpp
55 X86IntelAsmPrinter.cpp
66 )
7
8 target_name_of_partially_linked_object(LLVMX86CodeGen n)
9
10 add_dependencies(LLVMX86AsmPrinter ${n})
1919
2020 add_custom_target(X86Table_gen echo Tablegenning
2121 DEPENDS
22 ${llvm_builded_incs_dir}/Intrinsics.gen
2322 ${CMAKE_CURRENT_BINARY_DIR}/X86GenRegisterInfo.h.inc
2423 ${CMAKE_CURRENT_BINARY_DIR}/X86GenRegisterNames.inc
2524 ${CMAKE_CURRENT_BINARY_DIR}/X86GenRegisterInfo.inc
3231 ${CMAKE_CURRENT_BINARY_DIR}/X86GenCallingConv.inc
3332 ${CMAKE_CURRENT_BINARY_DIR}/X86GenSubtarget.inc
3433 )
34
35 add_dependencies(X86Table_gen ${LLVM_COMMON_DEPENDS})
3536
3637 include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
3738
6868
6969 add_custom_command(OUTPUT ${LIBDEPS_TMP}
7070 COMMAND ${PERL_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/GenLibDeps.pl -flat ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} > ${LIBDEPS_TMP}
71 DEPENDS ${llvm_libs}
7271 COMMENT "Regenerating ${LIBDEPS_TMP}")
7372
7473 add_custom_command(OUTPUT ${LIBDEPS}
9897 )
9998
10099 add_custom_target(llvm-config.target ALL
101 DEPENDS ${LLVM_CONFIG})
100 DEPENDS ${LLVM_CONFIG})
101
102 add_dependencies(llvm-config.target ${llvm_lib_targets})