mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-02-11 12:20:52 +00:00
105 lines
6.1 KiB
Diff
105 lines
6.1 KiB
Diff
diff --git a/swift/utils/swift_build_support/swift_build_support/products/cmark.py b/swift/utils/swift_build_support/swift_build_support/products/cmark.py
|
|
index b11313fab87..fe2e8982300 100644
|
|
--- a/swift/utils/swift_build_support/swift_build_support/products/cmark.py
|
|
+++ b/swift/utils/swift_build_support/swift_build_support/products/cmark.py
|
|
@@ -12,6 +12,9 @@
|
|
|
|
from . import cmake_product
|
|
from . import earlyswiftdriver
|
|
+from ..host_specific_configuration \
|
|
+ import HostSpecificConfiguration
|
|
+import os
|
|
|
|
|
|
class CMark(cmake_product.CMakeProduct):
|
|
@@ -54,7 +54,7 @@ class CMark(cmake_product.CMakeProduct):
|
|
|
|
self.cmake_options.define('CMARK_THREADING', 'ON')
|
|
|
|
- host_toolchain = self.generate_toolchain_file_for_darwin_or_linux(host_target)
|
|
+ host_toolchain = False # self.generate_toolchain_file_for_darwin_or_linux(host_target)
|
|
|
|
(platform, _) = host_target.split('-')
|
|
if not host_toolchain and platform == "openbsd":
|
|
@@ -68,6 +70,13 @@ class CMark(cmake_product.CMakeProduct):
|
|
toolchain_file = self.generate_linux_toolchain_file(platform, arch)
|
|
self.cmake_options.define('CMAKE_TOOLCHAIN_FILE:PATH', toolchain_file)
|
|
|
|
+ host_config = HostSpecificConfiguration(host_target, self.args)
|
|
+ self.cmake_options.extend(host_config.cmake_options)
|
|
+
|
|
+ if 'ANDROID_DATA' not in os.environ:
|
|
+ self.cmake_options.define('CMAKE_C_FLAGS', '%s --target=%s %s' % (os.environ.get('CFLAGS'), os.environ.get('CCTERMUX_HOST_PLATFORM'), os.environ.get('CPPFLAGS')))
|
|
+ self.cmake_options.define('CMAKE_CXX_FLAGS', '%s --target=%s %s' % (os.environ.get('CXXFLAGS'), os.environ.get('CCTERMUX_HOST_PLATFORM'), os.environ.get('CPPFLAGS')))
|
|
+
|
|
self.build_with_cmake(["all"], self.args.cmark_build_variant, [])
|
|
|
|
def should_test(self, host_target):
|
|
diff --git a/swift/utils/swift_build_support/swift_build_support/products/llvm.py b/swift/utils/swift_build_support/swift_build_support/products/llvm.py
|
|
index 744dca10fca..7b5932882f2 100644
|
|
--- a/swift/utils/swift_build_support/swift_build_support/products/llvm.py
|
|
+++ b/swift/utils/swift_build_support/swift_build_support/products/llvm.py
|
|
@@ -340,6 +340,12 @@ class LLVM(cmake_product.CMakeProduct):
|
|
llvm_cmake_options.define('CLANG_TABLEGEN', clang_tblgen)
|
|
llvm = os.path.join(host_build_dir, 'llvm')
|
|
llvm_cmake_options.define('LLVM_NATIVE_BUILD', llvm)
|
|
+ llvm_cmake_options.define('CMAKE_CXX_FLAGS', '{} --target={} {}'.format(os.environ['CXXFLAGS'], os.environ['CCTERMUX_HOST_PLATFORM'], os.environ['CPPFLAGS']))
|
|
+ llvm_cmake_options.define('CMAKE_EXE_LINKER_FLAGS', '{} --target={}'.format(os.environ['LDFLAGS'], os.environ['CCTERMUX_HOST_PLATFORM']))
|
|
+ llvm_cmake_options.define('CMAKE_FIND_ROOT_PATH:PATH', self.args.cross_compile_deps_path)
|
|
+ llvm_cmake_options.define('CMAKE_FIND_ROOT_PATH_MODE_PROGRAM', 'NEVER')
|
|
+ llvm_cmake_options.define('CMAKE_FIND_ROOT_PATH_MODE_LIBRARY', 'ONLY')
|
|
+
|
|
|
|
host_config = HostSpecificConfiguration(host_target, self.args)
|
|
|
|
diff --git a/swift/utils/swift_build_support/swift_build_support/products/product.py b/swift/utils/swift_build_support/swift_build_support/products/product.py
|
|
index 6bd94c3cad8..743f6ed3637 100644
|
|
--- a/swift/utils/swift_build_support/swift_build_support/products/product.py
|
|
+++ b/swift/utils/swift_build_support/swift_build_support/products/product.py
|
|
@@ -480,11 +480,12 @@ class Product(object):
|
|
# compile on Android does not use the NDK and its CMake config.
|
|
cross_compile = platform == "linux" or \
|
|
self.is_cross_compile_target(host_target)
|
|
- toolchain_file = self.generate_linux_toolchain_file(platform, arch,
|
|
+ if platform == "android":
|
|
+ if not cross_compile:
|
|
+ toolchain_file = self.generate_linux_toolchain_file(platform, arch,
|
|
cross_compile)
|
|
- self.cmake_options.define('CMAKE_TOOLCHAIN_FILE:PATH', toolchain_file)
|
|
+ self.cmake_options.define('CMAKE_TOOLCHAIN_FILE:PATH', toolchain_file)
|
|
|
|
- if cross_compile and platform == "android":
|
|
resource_dir = None
|
|
# build-script-impl products build before the install and use
|
|
# the Swift stdlib from the compiler build directory instead,
|
|
diff --git a/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py b/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py
|
|
index 324d1a77eea..bd5f9c79353 100644
|
|
--- a/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py
|
|
+++ b/swift/utils/swift_build_support/swift_build_support/products/swift_testing.py
|
|
@@ -13,6 +13,9 @@
|
|
import os
|
|
|
|
from build_swift.build_swift.versions import Version
|
|
+from ..host_specific_configuration \
|
|
+ import HostSpecificConfiguration
|
|
+from ..targets import StdlibDeploymentTarget
|
|
|
|
from . import cmake_product
|
|
from . import product
|
|
@@ -115,6 +117,15 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct):
|
|
# FIXME: If we build macros for the builder, specify the path.
|
|
self.cmake_options.define('SwiftTesting_MACRO', 'NO')
|
|
|
|
+ if host_target.startswith('android') and self.is_cross_compile_target(host_target):
|
|
+ host_config = HostSpecificConfiguration(host_target, self.args)
|
|
+ self.cmake_options.extend(host_config.cmake_options)
|
|
+ target = '%s-unknown-linux-android%s' % (self.args.android_arch,
|
|
+ self.args.android_api_level)
|
|
+ self.cmake_options.define('CMAKE_Swift_COMPILER_TARGET', target)
|
|
+ self.cmake_options.define('CMAKE_CXX_COMPILER_WORKS', 'True')
|
|
+ self.cmake_options.define('CMAKE_FIND_ROOT_PATH', self.args.cross_compile_deps_path)
|
|
+
|
|
self.generate_toolchain_file_for_darwin_or_linux(
|
|
host_target, override_macos_deployment_version=override_deployment_version)
|
|
self.build_with_cmake([], self.args.build_variant, [],
|