瀏覽代碼

[fix][building.py]修复动态模块的option的bug (#6081)

* [fix][building.py]修复动态模块option的bug
wugensheng 2 年之前
父節點
當前提交
ccbecfc220
共有 2 個文件被更改,包括 13 次插入4 次删除
  1. 11 1
      tools/building.py
  2. 2 3
      tools/options.py

+ 11 - 1
tools/building.py

@@ -389,6 +389,16 @@ def PrepareModuleBuilding(env, root_directory, bsp_directory):
     PreProcessor.process_contents(contents)
     PreProcessor.process_contents(contents)
     BuildOptions = PreProcessor.cpp_namespace
     BuildOptions = PreProcessor.cpp_namespace
 
 
+    AddOption('--buildlib',
+                      dest = 'buildlib',
+                      type = 'string',
+                      help = 'building library of a component')
+    AddOption('--cleanlib',
+                      dest = 'cleanlib',
+                      action = 'store_true',
+                      default = False,
+                      help = 'clean up the library by --buildlib')
+
     # add program path
     # add program path
     env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
     env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
 
 
@@ -607,7 +617,7 @@ def DefineGroup(name, src, depend, **parameters):
             paths.append(os.path.abspath(item))
             paths.append(os.path.abspath(item))
         group['LOCAL_CPPPATH'] = paths
         group['LOCAL_CPPPATH'] = paths
 
 
-    
+
     if rtconfig.PLATFORM == 'gcc':
     if rtconfig.PLATFORM == 'gcc':
         if 'CFLAGS' in group:
         if 'CFLAGS' in group:
             group['CFLAGS'] = utils.GCCC99Patch(group['CFLAGS'])
             group['CFLAGS'] = utils.GCCC99Patch(group['CFLAGS'])

+ 2 - 3
tools/options.py

@@ -26,8 +26,8 @@ from SCons.Script import AddOption
 import platform
 import platform
 
 
 def AddOptions():
 def AddOptions():
-    ''' ===== Add options to SCons ===== '''
-    
+    ''' ===== Add generic options to SCons ===== '''
+
     AddOption('--dist',
     AddOption('--dist',
                       dest = 'make-dist',
                       dest = 'make-dist',
                       action = 'store_true',
                       action = 'store_true',
@@ -120,4 +120,3 @@ def AddOptions():
                     action = 'store_true',
                     action = 'store_true',
                     default = False,
                     default = False,
                     help = 'make menuconfig for RT-Thread BSP')
                     help = 'make menuconfig for RT-Thread BSP')
-