forked from OSchip/llvm-project
[runtimes] Use llvm-libtool-darwin for runtimes build
It's full featured now and we can use it for the runtimes build instead of relying on an external libtool, which means the CMAKE_HOST_APPLE restriction serves no purpose either now. Restrict llvm-lipo to Darwin targets while I'm here, since it's only needed there. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D86367
This commit is contained in:
parent
a7d8aabf29
commit
2c80e2fe51
|
@ -112,7 +112,7 @@ if (COMPILER_RT_STANDALONE_BUILD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Ensure that fat libraries are built correctly on Darwin
|
# Ensure that fat libraries are built correctly on Darwin
|
||||||
if(CMAKE_HOST_APPLE AND APPLE)
|
if(APPLE)
|
||||||
include(UseLibtool)
|
include(UseLibtool)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
include(CompilerRTDarwinUtils)
|
include(CompilerRTDarwinUtils)
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_HOST_APPLE AND APPLE)
|
if(APPLE)
|
||||||
include(UseLibtool)
|
include(UseLibtool)
|
||||||
endif()
|
endif()
|
||||||
include(AddCompilerRT)
|
include(AddCompilerRT)
|
||||||
|
|
|
@ -53,8 +53,10 @@ function(llvm_ExternalProject_Add name source_dir)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
if(NOT ARG_TOOLCHAIN_TOOLS)
|
if(NOT ARG_TOOLCHAIN_TOOLS)
|
||||||
set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-lipo llvm-ranlib llvm-nm llvm-objdump)
|
set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objdump)
|
||||||
if(NOT _cmake_system_name STREQUAL Darwin)
|
if(_cmake_system_name STREQUAL Darwin)
|
||||||
|
list(APPEND ARG_TOOLCHAIN_TOOLS llvm-libtool-darwin llvm-lipo)
|
||||||
|
else()
|
||||||
# TODO: These tools don't fully support Mach-O format yet.
|
# TODO: These tools don't fully support Mach-O format yet.
|
||||||
list(APPEND ARG_TOOLCHAIN_TOOLS llvm-objcopy llvm-strip)
|
list(APPEND ARG_TOOLCHAIN_TOOLS llvm-objcopy llvm-strip)
|
||||||
endif()
|
endif()
|
||||||
|
@ -144,6 +146,9 @@ function(llvm_ExternalProject_Add name source_dir)
|
||||||
if(llvm-ar IN_LIST TOOLCHAIN_TOOLS)
|
if(llvm-ar IN_LIST TOOLCHAIN_TOOLS)
|
||||||
list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX})
|
list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
endif()
|
endif()
|
||||||
|
if(llvm-libtool-darwin IN_LIST TOOLCHAIN_TOOLS)
|
||||||
|
list(APPEND compiler_args -DCMAKE_LIBTOOL=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-libtool-darwin${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
|
endif()
|
||||||
if(llvm-lipo IN_LIST TOOLCHAIN_TOOLS)
|
if(llvm-lipo IN_LIST TOOLCHAIN_TOOLS)
|
||||||
list(APPEND compiler_args -DCMAKE_LIPO=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lipo${CMAKE_EXECUTABLE_SUFFIX})
|
list(APPEND compiler_args -DCMAKE_LIPO=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lipo${CMAKE_EXECUTABLE_SUFFIX})
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue