Skip to content

Commit

Permalink
Merge pull request #234 from nasa/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
LeStarch authored Nov 6, 2020
2 parents b905cdd + 8e5fd5a commit 9bf02f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Fw/Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# information should match the F prime decription information.
####
name="fprime",
version="1.5.2",
version="1.5.3",
license="Apache 2.0 License",
description="F Prime Flight Software core data types",
long_description="""
Expand Down
8 changes: 7 additions & 1 deletion Fw/Python/src/fprime/fbuild/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ def execute(self, target: Target, context: Path, make_args: dict):
context.absolute(),
make_args=make_args,
top_target=isinstance(target, GlobalTarget),
environment=self.settings.get("environment", None)
)

def generate(self, cmake_args):
Expand Down Expand Up @@ -459,7 +460,12 @@ def generate(self, cmake_args):
cmake_args.update(
{"CMAKE_BUILD_TYPE": self.build_type.get_cmake_build_type()}
)
self.cmake.generate_build(self.deployment, self.build_dir, cmake_args)
self.cmake.generate_build(
self.deployment,
self.build_dir,
cmake_args,
environment=self.settings.get("environment", None)
)
except CMakeException as cexc:
raise GenerateException(str(cexc)) from cexc

Expand Down
10 changes: 7 additions & 3 deletions Fw/Python/src/fprime/fbuild/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""
# Get a cache directory for building CMakeList file, if need and remove at exit
import collections
import copy
import functools
import itertools
import os
Expand Down Expand Up @@ -51,7 +52,7 @@ def set_verbose(self, verbose):
self.verbose = verbose

def execute_known_target(
self, target, build_dir, path, cmake_args=None, make_args=None, top_target=False
self, target, build_dir, path, cmake_args=None, make_args=None, top_target=False, environment=None
):
"""
Executes a known target for a given build_dir. Path will default to a known path.
Expand All @@ -61,6 +62,7 @@ def execute_known_target(
:param path: path to run target against. (default) current working directory
:param cmake_args: cmake args input
:param top_target: top-level target. Do not append path name
:param environment: environment to setup when executing CMake
:return: return code from CMake
"""
assert build_dir is not None, "Invalid build dir supplied"
Expand All @@ -87,7 +89,7 @@ def execute_known_target(
)
)
run_args = ["--build", build_dir]
environment = {}
environment = {} if environment is None else copy.copy(environment)
if self.verbose:
environment["VERBOSE"] = "1"
run_args.extend(["--target", cmake_target])
Expand Down Expand Up @@ -207,13 +209,14 @@ def get_fprime_configuration(self, fields, cmake_dir=None):
self._cmake_validate_build_dir(cmake_dir) # Validate the dir
return self._read_values_from_cache(fields, build_dir=cmake_dir)

def generate_build(self, source_dir, build_dir, args=None, ignore_output=False):
def generate_build(self, source_dir, build_dir, args=None, ignore_output=False, environment=None):
"""Generate a build directory for purposes of the build.
:param source_dir: source directory to generate from
:param build_dir: build directory to generate to
:param args: arguments to hand to CMake.
:param ignore_output: do not print the output where the user can see it
:param environment: environment to set when generating
"""
if not os.path.exists(build_dir):
os.makedirs(build_dir)
Expand All @@ -236,6 +239,7 @@ def generate_build(self, source_dir, build_dir, args=None, ignore_output=False):
workdir=build_dir,
print_output=not ignore_output,
write_override=True,
environment=environment
)

def get_cmake_module(self, path, build_dir):
Expand Down

0 comments on commit 9bf02f0

Please sign in to comment.