SConscript 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #-*- encoding: utf-8 -*-
  2. #---------------------------------------------------------------------------------
  3. # @File: Sconscript for Package
  4. # @Author: Copyright (c) 2018-2019, liu2guang 1004383796@qq.com
  5. #---------------------------------------------------------------------------------
  6. import os
  7. from building import *
  8. Import('RTT_ROOT')
  9. Import('rtconfig')
  10. #---------------------------------------------------------------------------------
  11. # Package configuration
  12. #---------------------------------------------------------------------------------
  13. PKGNAME = "libssh2"
  14. DEPENDS = ["PKG_USING_LIBCURL2RTT"]
  15. #---------------------------------------------------------------------------------
  16. # Compile the configuration
  17. #---------------------------------------------------------------------------------
  18. SOURCES = Glob("src/*.c")
  19. LOCAL_CPPPATH = []
  20. LOCAL_CCFLAGS = ""
  21. LOCAL_ASFLAGS = ""
  22. CPPPATH = [os.path.join(GetCurrentDir(), 'src'),
  23. os.path.join(GetCurrentDir(), 'include')]
  24. CCFLAGS = ""
  25. ASFLAGS = ""
  26. CPPDEFINES = ["HAVE_CONFIG_H", "BUILDING_LIBCURL"]
  27. LOCAL_CPPDEFINES = []
  28. LIBS = []
  29. LIBPATH = [GetCurrentDir()]
  30. LINKFLAGS = ""
  31. #---------------------------------------------------------------------------------
  32. # Feature clip configuration, optional
  33. #---------------------------------------------------------------------------------
  34. #---------------------------------------------------------------------------------
  35. # Compiler platform configuration, optional
  36. #---------------------------------------------------------------------------------
  37. if rtconfig.CROSS_TOOL == "gcc":
  38. LOCAL_CCFLAGS += ' -std=gnu99 -Ofast -w'
  39. if rtconfig.CROSS_TOOL == "iar":
  40. print("Warning: No iar platform was tested!!!")
  41. if rtconfig.CROSS_TOOL == "keil":
  42. LOCAL_CCFLAGS += ' --gnu -W --diag_suppress=870'
  43. #---------------------------------------------------------------------------------
  44. # System variables
  45. #---------------------------------------------------------------------------------
  46. objs = []
  47. root = GetCurrentDir()
  48. #---------------------------------------------------------------------------------
  49. # Sub target
  50. #---------------------------------------------------------------------------------
  51. list = os.listdir(root)
  52. if GetDepend(DEPENDS):
  53. for d in list:
  54. path = os.path.join(root, d)
  55. if os.path.isfile(os.path.join(path, 'SConscript')):
  56. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  57. #---------------------------------------------------------------------------------
  58. # Main target
  59. #---------------------------------------------------------------------------------
  60. objs += DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
  61. CPPPATH = CPPPATH,
  62. CCFLAGS = CCFLAGS,
  63. ASFLAGS = ASFLAGS,
  64. LOCAL_CPPPATH = LOCAL_CPPPATH,
  65. LOCAL_CCFLAGS = LOCAL_CCFLAGS,
  66. LOCAL_ASFLAGS = LOCAL_ASFLAGS,
  67. CPPDEFINES = CPPDEFINES,
  68. LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
  69. LIBS = LIBS,
  70. LIBPATH = LIBPATH,
  71. LINKFLAGS = LINKFLAGS)
  72. Return("objs")
  73. #---------------------------------------------------------------------------------
  74. # End
  75. #---------------------------------------------------------------------------------