#===============================================================================
#
#
# GENERAL DESCRIPTION
#    build script
#
# Copyright (c) 2009-2009 by QUALCOMM, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //components/rel/core.slpi/1.0/debugtrace/build/SConscript#8 $
#                      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
# --------   ---     ---------------------------------------------------------
#
#===============================================================================
import os
Import('env')
import qdss

env = env.Clone()

#-------------------------------------------------------------------------------
# Convert warnings to errors
#-------------------------------------------------------------------------------
env.Append(CCFLAGS = '-Werror')

#-------------------------------------------------------------------------------
# Publish Protected APIs
# these are accesible within QDSS
#-------------------------------------------------------------------------------

env.PublishProtectedApi('DEBUGTRACE',[
   "${DEBUGTRACE_INC_ROOT}/core/debugtrace/common/hal/inc",
   "${DEBUGTRACE_INC_ROOT}/core/debugtrace/csr/hal/inc",
   "${DEBUGTRACE_INC_ROOT}/core/debugtrace/common/src",
   "${DEBUGTRACE_INC_ROOT}/core/debugtrace/tlmm/hal/inc",
   "${DEBUGTRACE_INC_ROOT}/core/debugtrace/tracer/src",
])

if env.IsTargetEnable(qdss.BuildTags(['venus'])):
   env.PublishPrivateApi('DEBUGTRACE',[
      "${DEBUGTRACE_INC_ROOT}/core/debugtrace/common/hal/inc",
      "${DEBUGTRACE_INC_ROOT}/core/debugtrace/common/inc",
   ])

#-------------------------------------------------------------------------------
#Define QDSS features here
#----------------------------------
### Place qdss_init in standalone mode ###
#env.Replace(USES_QDSS_STANDALONE=True)

if 'USES_QDSS_STANDALONE' in env:
   if ((not env.IsTargetEnable(qdss.BuildTags(['sensor2']))) and
       (not env.IsTargetEnable(qdss.BuildTags(['audio'])))):
      env.Append(CCFLAGS = " -DQDSS_STANDALONE_MODE=1")


#Uncomment below line to enable UART logging of SW event ids
#env.Replace(USES_QDSS_UART_LOGGING=True)

if 'USES_QDSS_UART_LOGGING' in env:
   env.Append(CCFLAGS = " -DQDSS_UART_LOG")


if env.IsTargetEnable(qdss.BuildTags(['venus'])):
   env.Append(CCFLAGS = " -DTRACER_VENUS_BUILD")

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