# Copyright (c) 2018-2019, 2021 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.

Import('env')
env = env.Clone()

# Check if current architecture to be built for TA is supported on
# current target or not.
if not env.UserModePreferredArchitecture():
  print("Not building unneeded architecture: ", env["PROC"])
  Return()

target = 'example_app_ta' + ['32', '64'][env.Is64BitImage()]

includes = [
  '../inc',
  '../../shared_headers/'
]

sources = [
  'cipher_handler.c',
  'hash_handler.c',
  'listener_handler.c',
  'ta_main.c',
  'uptime_handler.c',
]

md = {
  'appName':      target,
  'privileges': [ 'default','System' ],
}

app = env.SecureAppBuilder(
  sources   = sources,
  includes  = includes,
  metadata  = md,
  image     = target,
)

env.Alias('example_app_ta', app)

Return('app')
