Skip to content

Commit

Permalink
BorringSSL support (#233)
Browse files Browse the repository at this point in the history
* add boringssl as an option for crypto
  • Loading branch information
DmitriyMusatkin authored May 2, 2023
1 parent bf53728 commit 85e7c3f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
5 changes: 4 additions & 1 deletion builder/actions/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def __init__(self, project, *, args_transformer=None):
self.args_transformer = args_transformer

def run(self, env):
toolchain = env.toolchain
sh = env.shell

for d in (env.build_dir, env.deps_dir, env.install_dir):
Expand All @@ -231,6 +230,10 @@ def run(self, env):
sh = env.shell
toolchain = env.toolchain

if not self.project.needs_tests(env):
print('Tests not needed for project. Skipping')
return

if toolchain.cross_compile:
print('WARNING: Running tests for cross compile is not yet supported')
return
Expand Down
2 changes: 1 addition & 1 deletion builder/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import sys
from collections import namedtuple
from functools import partial, lru_cache
from functools import partial

from builder.core.data import *
from builder.core.host import current_os, package_tool
Expand Down
38 changes: 38 additions & 0 deletions builder/imports/boringssl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.

from builder.core.project import Project, Import


config = {
'targets': ['macos', 'linux', 'android'],
'test_steps': [],
'build_tests': False,
'cmake_args': []
}


class BoringSSLImport(Import):
def __init__(self, **kwargs):
super().__init__(
library=True,
name='boringssl',
config=config,
**kwargs)

def cmake_args(self, env):
assert self.installed
return super().cmake_args(env) + [
"-DLibCrypto_INCLUDE_DIR={}/include".format(self.prefix),
"-DLibCrypto_STATIC_LIBRARY={}/lib/libcrypto.a".format(
self.prefix),
]


class BoringSSLProject(Project):
def __init__(self, **kwargs):
super().__init__(
account='google',
url='https://github.com/google/boringssl.git',
**config,
**kwargs)

0 comments on commit 85e7c3f

Please sign in to comment.