mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Only bring over supporting change of generate_linux_toolchain_file() from fcc03898c,
specifically the change that makes the following possible on linux:
"* under Linux, do not cross compile LLVM when building for the host
architecture -- that will ensure that the compiler-rt build will use
the just built compiler and not the system one (which may not be
new enough for this purpose);"
This commit is contained in:
@@ -389,7 +389,7 @@ class Product(object):
|
||||
sysroot_arch, vendor, abi = self.get_linux_target_components(arch)
|
||||
return '{}-{}-linux-{}'.format(sysroot_arch, vendor, abi)
|
||||
|
||||
def generate_linux_toolchain_file(self, platform, arch):
|
||||
def generate_linux_toolchain_file(self, platform, arch, crosscompiling=True):
|
||||
"""
|
||||
Generates a new CMake tolchain file that specifies Linux as a target
|
||||
platform.
|
||||
@@ -402,8 +402,9 @@ class Product(object):
|
||||
|
||||
toolchain_args = {}
|
||||
|
||||
toolchain_args['CMAKE_SYSTEM_NAME'] = 'Linux'
|
||||
toolchain_args['CMAKE_SYSTEM_PROCESSOR'] = arch
|
||||
if crosscompiling:
|
||||
toolchain_args['CMAKE_SYSTEM_NAME'] = 'Linux'
|
||||
toolchain_args['CMAKE_SYSTEM_PROCESSOR'] = arch
|
||||
|
||||
# We only set the actual sysroot if we are actually cross
|
||||
# compiling. This is important since otherwise cmake seems to change the
|
||||
|
||||
Reference in New Issue
Block a user