SConscript 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import rtconfig
  2. from building import *
  3. # get current directory
  4. cwd = GetCurrentDir()
  5. # The set of source files associated with this SConscript file.
  6. CPPDEFINES = []
  7. sdk_path = os.path.join(cwd, "EVT", "EXAM", "SRC")
  8. patch_path = os.path.join(cwd, "rtt-patch")
  9. src = Glob(os.path.join(sdk_path, "Core", "*.c")) + \
  10. Glob(os.path.join(sdk_path, "Peripheral", "src", "*.c")) + \
  11. Glob(os.path.join(patch_path, "*.c"))
  12. path = [
  13. os.path.join(sdk_path, "Core"),
  14. os.path.join(sdk_path, "Peripheral", "inc"),
  15. patch_path
  16. ]
  17. if GetDepend(['SOC_RISCV_SERIES_CH32V20x_D6']):
  18. print("CH32V20x_D6 is not supported yet.")
  19. src += Glob(os.path.join(patch_path, "startup_ch32v20x_D6.S"))
  20. CPPDEFINES.append("CH32V20x_D6")
  21. Exit()
  22. elif GetDepend(['SOC_RISCV_SERIES_CH32V20x_D8']):
  23. print("CH32V20x_D8 is not supported yet.")
  24. src += Glob(os.path.join(patch_path, "startup_ch32v20x_D8.S"))
  25. CPPDEFINES.append("CH32V20x_D8")
  26. Exit()
  27. elif GetDepend(['SOC_RISCV_SERIES_CH32V20x_D8W']):
  28. src += Glob(os.path.join(patch_path, "startup_ch32v20x_D8W.S"))
  29. CPPDEFINES.append("CH32V20x_D8W")
  30. group = DefineGroup(
  31. 'Libraries',
  32. src,
  33. depend=['PKG_USING_CH32V20x_SDK'],
  34. CPPPATH=path,
  35. CPPDEFINES=CPPDEFINES,
  36. )
  37. # TODO BLE lib is under `EVT/EXAM/BLE`, not support yet.
  38. Return('group')