diff --git a/SConstruct b/SConstruct index c88498f..3f6886c 100644 --- a/SConstruct +++ b/SConstruct @@ -2,6 +2,15 @@ import os import sys import rtconfig +# 增加参数 --custom EDU_Training +AddOption( + "--custom", + dest="custom", + type="string", + help="Specify the custom version, Edu_training etc.", +) + + if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') else: @@ -30,6 +39,10 @@ env = Environment(tools = ['mingw'], LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env.PrependENVPath('PATH', rtconfig.EXEC_PATH) +if GetOption("custom") == "EDU_Training": + env.Append(CPPDEFINES=["EDU_TRAINING"]) + print("Custom version: " + GetOption("custom")) + if rtconfig.PLATFORM in ['iccarm']: env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES']) env.Replace(ARFLAGS = [''])