2025-04-08 18:46:12 +08:00

91 lines
3.4 KiB
Python

#-*- encoding: utf-8 -*-
#---------------------------------------------------------------------------------
# @File: Sconscript for Package
# @Author: Copyright (c) 2018-2019, Shanghai Real-Thread Technology Co., Ltd
#---------------------------------------------------------------------------------
import os
from building import *
Import('RTT_ROOT')
Import('rtconfig')
#---------------------------------------------------------------------------------
# Package configuration
#---------------------------------------------------------------------------------
PKGNAME = "player"
DEPENDS = ["PKG_USING_PLAYER"]
#---------------------------------------------------------------------------------
# Compile the configuration
#---------------------------------------------------------------------------------
SOURCES = []
LOCAL_CPPPATH = []
LOCAL_CCFLAGS = ""
LOCAL_ASFLAGS = ""
CPPPATH = [os.path.join(GetCurrentDir(), 'player'),
os.path.join(GetCurrentDir(), 'player/basic'),
os.path.join(GetCurrentDir(), 'player/codec'),
os.path.join(GetCurrentDir(), 'player/netstream')
]
CCFLAGS = ""
ASFLAGS = ""
CPPDEFINES = []
LOCAL_CPPDEFINES = []
LIBS = ["libplayer_gcc.a"]
LIBPATH = [GetCurrentDir()]
LINKFLAGS = ""
#---------------------------------------------------------------------------------
# Compiler platform configuration, optional
#---------------------------------------------------------------------------------
if rtconfig.CROSS_TOOL == "gcc":
LOCAL_CCFLAGS += ' -std=gnu99'
if rtconfig.CROSS_TOOL == "iar":
print("Warning: No iar platform was tested!!!")
if rtconfig.CROSS_TOOL == "keil":
LOCAL_CCFLAGS += ' --gnu -W --diag_suppress=870'
#---------------------------------------------------------------------------------
# System variables
#---------------------------------------------------------------------------------
objs = []
root = GetCurrentDir()
#---------------------------------------------------------------------------------
# Sub target
#---------------------------------------------------------------------------------
list = os.listdir(root)
if GetDepend(DEPENDS):
for d in list:
path = os.path.join(root, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
#---------------------------------------------------------------------------------
# Main target
#---------------------------------------------------------------------------------
objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
CPPPATH = CPPPATH,
CCFLAGS = CCFLAGS,
ASFLAGS = ASFLAGS,
LOCAL_CPPPATH = LOCAL_CPPPATH,
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
CPPDEFINES = CPPDEFINES,
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
LIBS = LIBS,
LIBPATH = LIBPATH,
LINKFLAGS = LINKFLAGS)
Return("objs")
#---------------------------------------------------------------------------------
# End
#---------------------------------------------------------------------------------