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

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

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

sources = [
  'ca_main.c',
  'run_gp_basic.c',
  'run_gp_time.c'
]

# The name of the TA to load is defined as EXAMPLE_GPAPP_GP_NAME
# GP only support 32 bits
example_gpapp_ta_name = '11111111-1111-1111-1111-111111111111'

env.Append(CPPDEFINES = \
           'EXAMPLE_GPAPP_TA_NAME=\\"{}\\"'.format(example_gpapp_ta_name))

# TA_INSTALL_PATH is added to the env in the calling SConstruct.
env.Append(CPPDEFINES='TA_PATH_DEFINE=\\"{}\\"'.format(env['TA_INSTALL_PATH']))

app = env.OfftargetClientAppBuilder(
  includes = includes,
  sources = sources,
  image = 'example_gpapp_ca',
)

env.Alias('example_gpapp_ca', app)

env.Depends(app, env.Alias('installed_ta'))

Return('app')
