#===============================================================================
#
# MPROC Libs
#
# GENERAL DESCRIPTION
#    build script
#
# Copyright (c) 2009-2018 by QUALCOMM Technologies, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //components/rel/core.qdsp6/5.1/mproc/glink/build/SConscript#1 $
#  $DateTime: 2019/11/13 11:21:35 $
#  $Author: pwbldsvc $
#  $Change: 21373441 $
#                      EDIT HISTORY FOR FILE
#
#  This section contains comments describing changes made to the module.
#  Notice that changes are listed in reverse chronological order.
#
# when       who     what, where, why
# --------   ---     ---------------------------------------------------------
# 08/03/15   db      Corrected TN build tags
# 06/19/15   pp      Update to use Ulogs and feature enabled for Modem/ADSP/SLPI
# 06/10/15   bc      Define macro for secure processor integration
#===============================================================================
Import('env')
import os
env = env.Clone()

#-------------------------------------------------------------------------------
# Decide glink build root 
#-------------------------------------------------------------------------------
if env.IsTargetEnable('MISSIONROM_IMAGE'):
  GLINK_BUILD_ROOT = "${BUILD_ROOT}/missionrom/core/mproc/glink"
else:
  GLINK_BUILD_ROOT = "${BUILD_ROOT}/core/mproc/glink"

Export('GLINK_BUILD_ROOT')

#-------------------------------------------------------------------------------
# Convert warnings to errors 
#-------------------------------------------------------------------------------
if env.has_key('CORE_RPM'):
        env.Append(CFLAGS = "-W ")
elif not os.environ.get('COMPILER','gcc').startswith('llvm'):
        env.Append(CFLAGS = "-Werror ")

#-------------------------------------------------------------------------------
# Publish Protected APIs
#-------------------------------------------------------------------------------
env.PublishProtectedApi('MPROC_GLINK', [
   "${INC_ROOT}/core/mproc/glink/core/inc",
])

# Images that will have full glink features
FULL_GLINK_FEAUTRE_IMAGES = ['CBSP_APPS_IMAGE', 'APPS_IMAGE', 'CORE_QDSP6_SW',
                             'CORE_MPSS_ROOT', 'CORE_ADSP_ROOT', 'CORE_SLPI_ROOT',
                             'CORE_ADSP_SLPI_ROOT', 'CORE_CDSP_ROOT','CORE_Q6_ROOT']

if env.IsTargetEnable(FULL_GLINK_FEAUTRE_IMAGES):
  env.Append(CPPDEFINES=['FEATURE_TRACER_PACKET',
                         'GLINK_OS_DEFINED_LOGGING' , 
                         'GLINK_CHANNEL_STATS_ENABLED'])

#-------------------------------------------------------------------------------
# Load sub scripts
#-------------------------------------------------------------------------------
env.LoadSoftwareUnits()
env.LoadImageUnits()
