diff --git a/CMakeLists.txt b/CMakeLists.txt index 543ee7f8807..2ee79a568d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,9 +180,6 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib ) add_llvm_definitions( -D__STDC_LIMIT_MACROS ) add_llvm_definitions( -D__STDC_CONSTANT_MACROS ) -set(LLVM_PLO_FLAGS "" CACHE - STRING "Flags for creating partially linked objects.") - if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) # TODO: support other platforms and toolchains. option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF) @@ -221,7 +218,6 @@ endif( MSVC ) include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR}) include(AddLLVM) -include(AddPartiallyLinkedObject) include(TableGen) add_subdirectory(lib/Support) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index e5256746bcc..2b9b649da2d 100755 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -61,8 +61,10 @@ macro(add_llvm_target target_name) add_dependencies(${target_name}Table_gen ${LLVM_COMMON_DEPENDS}) endif( TABLEGEN_OUTPUT ) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) - add_partially_linked_object(LLVM${target_name} ${ARGN}) + add_llvm_library(LLVM${target_name} ${ARGN} ${TABLEGEN_OUTPUT}) + if (FALSE) if( TABLEGEN_OUTPUT ) add_dependencies(LLVM${target_name} ${target_name}Table_gen) endif( TABLEGEN_OUTPUT ) + endif () endmacro(add_llvm_target) diff --git a/cmake/modules/AddPartiallyLinkedObject.cmake b/cmake/modules/AddPartiallyLinkedObject.cmake deleted file mode 100755 index 0f92455eacd..00000000000 --- a/cmake/modules/AddPartiallyLinkedObject.cmake +++ /dev/null @@ -1,42 +0,0 @@ -include(LLVMProcessSources) - -macro(target_name_of_partially_linked_object lib var) - if( USE_EXPLICIT_DEPENDENCIES ) - set(${var} ${lib}) - else( ) - set(${var} ${lib}_pll) - endif( ) -endmacro(target_name_of_partially_linked_object lib var) - - -macro(add_partially_linked_object lib) - if( USE_EXPLICIT_DEPENDENCIES ) - add_llvm_library( ${lib} ${ARGN}) - else( ) - set(pll ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${lib}.o) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib) - llvm_process_sources( ALL_FILES ${ARGN} ) - if( BUILD_SHARED_LIBS AND SUPPORTS_FPIC_FLAG ) - add_definitions(-fPIC) - endif() - add_library( ${lib} STATIC ${ALL_FILES}) - 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} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib/${CMAKE_CFG_INTDIR} - COMMAND ar x ${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX} - COMMAND ${CMAKE_LINKER} "${LLVM_PLO_FLAGS}" -r "*${CMAKE_CXX_OUTPUT_EXTENSION}" -o ${pll} - COMMAND ${CMAKE_COMMAND} -E remove -f *${CMAKE_CXX_OUTPUT_EXTENSION} - ) - 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( ) - install(FILES ${pll} - DESTINATION lib${LLVM_LIBDIR_SUFFIX}) -endmacro(add_partially_linked_object lib) diff --git a/lib/ExecutionEngine/CMakeLists.txt b/lib/ExecutionEngine/CMakeLists.txt index e26b98fb9d4..0e118ccd904 100644 --- a/lib/ExecutionEngine/CMakeLists.txt +++ b/lib/ExecutionEngine/CMakeLists.txt @@ -1,4 +1,4 @@ -add_partially_linked_object(LLVMExecutionEngine +add_llvm_library(LLVMExecutionEngine ExecutionEngine.cpp ExecutionEngineBindings.cpp ) diff --git a/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/lib/ExecutionEngine/Interpreter/CMakeLists.txt index 626e804e78e..dff97fa26e8 100644 --- a/lib/ExecutionEngine/Interpreter/CMakeLists.txt +++ b/lib/ExecutionEngine/Interpreter/CMakeLists.txt @@ -1,4 +1,4 @@ -add_partially_linked_object(LLVMInterpreter +add_llvm_library(LLVMInterpreter Execution.cpp ExternalFunctions.cpp Interpreter.cpp diff --git a/lib/ExecutionEngine/JIT/CMakeLists.txt b/lib/ExecutionEngine/JIT/CMakeLists.txt index d7980d07728..e0c13a10f0b 100644 --- a/lib/ExecutionEngine/JIT/CMakeLists.txt +++ b/lib/ExecutionEngine/JIT/CMakeLists.txt @@ -1,7 +1,7 @@ # TODO: Support other architectures. See Makefile. add_definitions(-DENABLE_X86_JIT) -add_partially_linked_object(LLVMJIT +add_llvm_library(LLVMJIT Intercept.cpp JIT.cpp JITDwarfEmitter.cpp diff --git a/lib/Target/ARM/AsmPrinter/CMakeLists.txt b/lib/Target/ARM/AsmPrinter/CMakeLists.txt index 524a748665b..c22964f6c87 100644 --- a/lib/Target/ARM/AsmPrinter/CMakeLists.txt +++ b/lib/Target/ARM/AsmPrinter/CMakeLists.txt @@ -1,9 +1,5 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMARMAsmPrinter +add_llvm_library(LLVMARMAsmPrinter ARMAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMARMCodeGen n) - -add_dependencies(LLVMARMAsmPrinter ${n}) diff --git a/lib/Target/Alpha/AsmPrinter/CMakeLists.txt b/lib/Target/Alpha/AsmPrinter/CMakeLists.txt index b62a7f68356..bf047625bac 100644 --- a/lib/Target/Alpha/AsmPrinter/CMakeLists.txt +++ b/lib/Target/Alpha/AsmPrinter/CMakeLists.txt @@ -1,9 +1,5 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMAlphaAsmPrinter +add_llvm_library(LLVMAlphaAsmPrinter AlphaAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMAlphaCodeGen n) - -add_dependencies(LLVMAlphaAsmPrinter ${n}) diff --git a/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt b/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt index 4336b057a34..0dad0834041 100644 --- a/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt +++ b/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt @@ -3,10 +3,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMCellSPUAsmPrinter +add_llvm_library(LLVMCellSPUAsmPrinter SPUAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMCellSPUCodeGen n) - -add_dependencies(LLVMCellSPUAsmPrinter ${n}) diff --git a/lib/Target/IA64/AsmPrinter/CMakeLists.txt b/lib/Target/IA64/AsmPrinter/CMakeLists.txt index 1d552bd5551..b81ed4a8d0d 100644 --- a/lib/Target/IA64/AsmPrinter/CMakeLists.txt +++ b/lib/Target/IA64/AsmPrinter/CMakeLists.txt @@ -3,10 +3,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMIA64AsmPrinter +add_llvm_library(LLVMIA64AsmPrinter IA64AsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMIA64CodeGen n) - -add_dependencies(LLVMIA64AsmPrinter ${n}) diff --git a/lib/Target/Mips/AsmPrinter/CMakeLists.txt b/lib/Target/Mips/AsmPrinter/CMakeLists.txt index 6a868c2fc78..942548dfc47 100644 --- a/lib/Target/Mips/AsmPrinter/CMakeLists.txt +++ b/lib/Target/Mips/AsmPrinter/CMakeLists.txt @@ -3,10 +3,6 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMMipsAsmPrinter +add_llvm_library(LLVMMipsAsmPrinter MipsAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMMipsCodeGen n) - -add_dependencies(LLVMMipsAsmPrinter ${n}) diff --git a/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt b/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt index 1ed483ab21e..1f80b17a384 100644 --- a/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt +++ b/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt @@ -1,9 +1,5 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMPowerPCAsmPrinter +add_llvm_library(LLVMPowerPCAsmPrinter PPCAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMPowerPCCodeGen n) - -add_dependencies(LLVMPowerPCAsmPrinter ${n}) diff --git a/lib/Target/Sparc/AsmPrinter/CMakeLists.txt b/lib/Target/Sparc/AsmPrinter/CMakeLists.txt index 394b4cd40e7..de905a92128 100644 --- a/lib/Target/Sparc/AsmPrinter/CMakeLists.txt +++ b/lib/Target/Sparc/AsmPrinter/CMakeLists.txt @@ -1,9 +1,5 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMSparcAsmPrinter +add_llvm_library(LLVMSparcAsmPrinter SparcAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMSparcCodeGen n) - -add_dependencies(LLVMSparcAsmPrinter ${n}) diff --git a/lib/Target/X86/AsmPrinter/CMakeLists.txt b/lib/Target/X86/AsmPrinter/CMakeLists.txt index 368bcaa5ce3..2079a9fd271 100644 --- a/lib/Target/X86/AsmPrinter/CMakeLists.txt +++ b/lib/Target/X86/AsmPrinter/CMakeLists.txt @@ -1,12 +1,8 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.. ) -add_partially_linked_object(LLVMX86AsmPrinter +add_llvm_library(LLVMX86AsmPrinter X86ATTAsmPrinter.cpp X86ATTInstPrinter.cpp X86AsmPrinter.cpp X86IntelAsmPrinter.cpp ) - -target_name_of_partially_linked_object(LLVMX86CodeGen n) - -add_dependencies(LLVMX86AsmPrinter ${n})