#===============================================================================
#
# App Core
#
# GENERAL DESCRIPTION
#    build script
#===============================================================================
Import('env')
env = env.Clone()

if not env.CheckAlias(['gpsample','deploy']):
  Return()


env['GPSAMPLE_IMAGE'] = True
env['APP_NAME'] = 'gpsample'
env.Replace(LIB_OUT_DIR = '${BUILD_ROOT}/ssg/bsp/trustzone/qsapps/$APP_NAME/build/${SHORT_BUILDPATH}/$PROC')
env.Replace(OUT_DIR = '${BUILD_ROOT}/ssg/bsp/trustzone/qsapps/$APP_NAME/build/${SHORT_BUILDPATH}/$PROC')
  
#------------------------------------------------------------------------------
# We need to specify "neon" to generate SIMD instructions in 32-bit mode
#------------------------------------------------------------------------------
if env['PROC'] == 'scorpion':
  env.Append(CCFLAGS = " -mfpu=neon ")

#----------------------------------------------------------------------------
# App core Objects
#----------------------------------------------------------------------------
sources = [
  'gpsample.c',
]

#-------------------------------------------------------------------------------
# Add metadata to image
#-------------------------------------------------------------------------------
# privileges: all
# services:   COEMUnwrapKeys_UID (60)
md = {
    'appName':      'gpsample',
    'UUID':         '5AF8C3E6-D9DF-446E-4ff2-d4d58e8ca49b',
    'privileges': [ 'default', 'System' ],
}

app_units = env.SecureAppBuilder(
  sources = sources,
  includes = None,
  metadata = md,
  image = 'gpsample',
  deploy_sources = [sources, 'SConscript'],
  deploy_variants = env.GetDefaultPublicVariants()
)

op = env.Alias('gpsample', app_units)
Return('app_units')
