Skip to content

Commit

Permalink
Validate existence of environment variables only at the time of usage…
Browse files Browse the repository at this point in the history
… instead of a global prerequisite for tizen (#18263)
  • Loading branch information
andy31415 authored and pull[bot] committed Oct 12, 2023
1 parent 73b6fac commit 93d4d4a
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions scripts/build/builders/tizen.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ def __init__(self,
root=os.path.join(root, 'examples', app.ExampleName(), 'linux'),
runner=runner)

# Make sure that required ENV variables are defined
for env in ('TIZEN_SDK_ROOT', 'TIZEN_SDK_SYSROOT'):
if env not in os.environ:
raise Exception(
"Environment %s missing, cannot build Tizen target" % env)

self.tizen_sdk_root = os.environ['TIZEN_SDK_ROOT']
self.tizen_sdk_sysroot = os.environ['TIZEN_SDK_SYSROOT']
self.tizen_sdk_cli = os.path.join(
self.tizen_sdk_root, "tools/ide/bin/tizen")

self.app = app
self.board = board
self.extra_gn_options = []
Expand All @@ -85,11 +74,17 @@ def __init__(self,
raise Exception("TSAN sanitizer not supported by Tizen toolchain")

def GnBuildArgs(self):
# Make sure that required ENV variables are defined
for env in ('TIZEN_SDK_ROOT', 'TIZEN_SDK_SYSROOT'):
if env not in os.environ:
raise Exception(
"Environment %s missing, cannot build Tizen target" % env)

return self.extra_gn_options + [
'target_os="tizen"',
'target_cpu="%s"' % self.board.TargetCpuName(),
'tizen_sdk_root="%s"' % self.tizen_sdk_root,
'sysroot="%s"' % self.tizen_sdk_sysroot,
'tizen_sdk_root="%s"' % os.environ['TIZEN_SDK_ROOT'],
'sysroot="%s"' % os.environ['TIZEN_SDK_SYSROOT'],
]

def build_outputs(self):
Expand Down

0 comments on commit 93d4d4a

Please sign in to comment.