mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-10-02 06:47:23 +00:00
Build library using CMake
Signed-off-by: Bence Szépkúti <[email protected]>
This commit is contained in:
@@ -138,7 +138,7 @@ class AbiChecker:
|
|||||||
self.check_storage_tests = configuration.check_storage
|
self.check_storage_tests = configuration.check_storage
|
||||||
self.brief = configuration.brief
|
self.brief = configuration.brief
|
||||||
self.git_command = "git"
|
self.git_command = "git"
|
||||||
self.make_command = "make"
|
self.cmake_command = "cmake"
|
||||||
|
|
||||||
def _setup_logger(self):
|
def _setup_logger(self):
|
||||||
self.log = logging.getLogger()
|
self.log = logging.getLogger()
|
||||||
@@ -150,6 +150,7 @@ class AbiChecker:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_abi_tools_are_installed():
|
def check_abi_tools_are_installed():
|
||||||
|
return
|
||||||
for command in ["abi-dumper", "abi-compliance-checker"]:
|
for command in ["abi-dumper", "abi-compliance-checker"]:
|
||||||
if not shutil.which(command):
|
if not shutil.which(command):
|
||||||
raise Exception("{} not installed, aborting".format(command))
|
raise Exception("{} not installed, aborting".format(command))
|
||||||
@@ -225,23 +226,30 @@ class AbiChecker:
|
|||||||
|
|
||||||
def _build_shared_libraries(self, git_worktree_path, version):
|
def _build_shared_libraries(self, git_worktree_path, version):
|
||||||
"""Build the shared libraries in the specified worktree."""
|
"""Build the shared libraries in the specified worktree."""
|
||||||
my_environment = os.environ.copy()
|
build_dir = os.path.join(git_worktree_path, "build")
|
||||||
my_environment["CFLAGS"] = "-g -Og"
|
os.mkdir(build_dir)
|
||||||
my_environment["SHARED"] = "1"
|
configure_output = subprocess.check_output(
|
||||||
|
[
|
||||||
if os.path.exists(os.path.join(git_worktree_path, "scripts", "legacy.make")):
|
self.cmake_command, "..",
|
||||||
command = [self.make_command, "-f", "scripts/legacy.make", "lib"]
|
"-DCMAKE_BUILD_TYPE=Debug",
|
||||||
else:
|
"-DENABLE_TESTING=OFF",
|
||||||
command = [self.make_command, "lib"]
|
"-DENABLE_PROGRAMS=OFF",
|
||||||
|
"-DUSE_SHARED_MBEDTLS_LIBRARY=ON",
|
||||||
make_output = subprocess.check_output(
|
"-DUSE_STATIC_MBEDTLS_LIBRARY=OFF",
|
||||||
command,
|
"-DUSE_SHARED_TF_PSA_CRYPTO_LIBRARY=ON",
|
||||||
env=my_environment,
|
"-DUSE_STATIC_TF_PSA_CRYPTO_LIBRARY=OFF",
|
||||||
cwd=git_worktree_path,
|
],
|
||||||
|
cwd=build_dir,
|
||||||
stderr=subprocess.STDOUT
|
stderr=subprocess.STDOUT
|
||||||
)
|
)
|
||||||
self.log.debug(make_output.decode("utf-8"))
|
self.log.debug(configure_output.decode("utf-8"))
|
||||||
for root, _dirs, files in os.walk(git_worktree_path):
|
|
||||||
|
build_output = subprocess.check_output(
|
||||||
|
[self.cmake_command, "--build", build_dir],
|
||||||
|
stderr=subprocess.STDOUT
|
||||||
|
)
|
||||||
|
self.log.debug(build_output.decode("utf-8"))
|
||||||
|
for root, _dirs, files in os.walk(build_dir):
|
||||||
for file in fnmatch.filter(files, "*.so"):
|
for file in fnmatch.filter(files, "*.so"):
|
||||||
version.modules[os.path.splitext(file)[0]] = (
|
version.modules[os.path.splitext(file)[0]] = (
|
||||||
os.path.join(root, file)
|
os.path.join(root, file)
|
||||||
@@ -384,6 +392,7 @@ class AbiChecker:
|
|||||||
|
|
||||||
def _cleanup_worktree(self, git_worktree_path):
|
def _cleanup_worktree(self, git_worktree_path):
|
||||||
"""Remove the specified git worktree."""
|
"""Remove the specified git worktree."""
|
||||||
|
return
|
||||||
shutil.rmtree(git_worktree_path)
|
shutil.rmtree(git_worktree_path)
|
||||||
submodule_output = subprocess.check_output(
|
submodule_output = subprocess.check_output(
|
||||||
[self.git_command, "submodule", "foreach", "--recursive",
|
[self.git_command, "submodule", "foreach", "--recursive",
|
||||||
|
|||||||
Reference in New Issue
Block a user