# Copyright (c) 2019, 2021, 2023 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()

# GP only support 32 bits
target = 'example_gpapp_ta32'

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

sources = [
  'gp_time.c',
  'gp_basic.c',
  'ta_main.c'
]

#-------------------------------------------------------------------------------
# Add metadata to image
#-------------------------------------------------------------------------------
md = {
  'appName':      target,
  'UUID':         '11111111-1111-1111-1111-111111111111',
  'multiSession': 'true',
  'privileges': [ 'default', 'System' ],
  'acceptBufSize': 16384 #Defined to meet 4096 buffer requirement of run_invoke_multiplyHLOSBuffer test.
}

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

env.Alias('example_gpapp_ta', app)

Return('app')
