diff options
Diffstat (limited to 'tools/run_tests/artifact_targets.py')
-rw-r--r-- | tools/run_tests/artifact_targets.py | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index b565fbb3f0..f84d35580b 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -79,6 +79,12 @@ def macos_arch_env(arch): raise Exception('Unsupported arch') return {'CFLAGS': arch_arg, 'LDFLAGS': arch_arg} +_MACOS_COMPAT_FLAG = '-mmacosx-version-min=10.7' + +_ARCH_FLAG_MAP = { + 'x86': '-m32', + 'x64': '-m64' +} python_version_arch_map = { 'x86': 'Python27_32bits', @@ -199,6 +205,7 @@ class CSharpExtArtifact: def __str__(self): return self.name + node_gyp_arch_map = { 'x86': 'ia32', 'x64': 'x64' @@ -235,10 +242,54 @@ class NodeExtArtifact: self.gyp_arch]) +class ProtocArtifact: + """Builds protoc and protoc-plugin artifacts""" + + def __init__(self, platform, arch): + self.name = 'protoc_%s_%s' % (platform, arch) + self.platform = platform + self.arch = arch + self.labels = ['artifact', 'protoc', platform, arch] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if self.platform != 'windows': + cxxflags = '-DNDEBUG %s' % _ARCH_FLAG_MAP[self.arch] + ldflags = '%s' % _ARCH_FLAG_MAP[self.arch] + if self.platform != 'macos': + ldflags += ' -static-libgcc -static-libstdc++ -s' + environ={'CONFIG': 'opt', + 'CXXFLAGS': cxxflags, + 'LDFLAGS': ldflags, + 'PROTOBUF_LDFLAGS_EXTRA': ldflags} + if self.platform == 'linux': + return create_docker_jobspec(self.name, + 'tools/dockerfile/grpc_artifact_protoc', + 'tools/run_tests/build_artifact_protoc.sh', + environ=environ) + else: + environ['CXXFLAGS'] += ' -std=c++11 -stdlib=libc++ %s' % _MACOS_COMPAT_FLAG + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_protoc.sh'], + environ=environ) + else: + generator = 'Visual Studio 12 Win64' if self.arch == 'x64' else 'Visual Studio 12' + vcplatform = 'x64' if self.arch == 'x64' else 'Win32' + return create_jobspec(self.name, + ['tools\\run_tests\\build_artifact_protoc.bat'], + environ={'generator': generator, + 'Platform': vcplatform}) + + def __str__(self): + return self.name + + def targets(): """Gets list of supported targets""" return ([Cls(platform, arch) - for Cls in (CSharpExtArtifact, NodeExtArtifact) + for Cls in (CSharpExtArtifact, NodeExtArtifact, ProtocArtifact) for platform in ('linux', 'macos', 'windows') for arch in ('x86', 'x64')] + [PythonArtifact('linux', 'x86'), |