SConscript 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from building import *
  2. import rtconfig
  3. import os
  4. # get current directory
  5. cwd = GetCurrentDir()
  6. # The set of source files associated with this SConscript file.
  7. src = []
  8. for root, dirs, files in os.walk(cwd + '/libsodium'):
  9. for file in files:
  10. if file.endswith('.c'):
  11. src.append(os.path.join(root, file))
  12. # Examples
  13. if GetDepend('LIBSODIUM_USING_EXAMPLE_SHA256'):
  14. src += Glob('examples/sha256.c')
  15. if GetDepend('LIBSODIUM_USING_EXAMPLE_SHA512'):
  16. src += Glob('examples/sha512.c')
  17. if GetDepend('LIBSODIUM_USING_EXAMPLE_GENERIC_HASH'):
  18. src += Glob('examples/generic_hash.c')
  19. if GetDepend('LIBSODIUM_USING_EXAMPLE_SHORT_HASH'):
  20. src += Glob('examples/short_hash.c')
  21. # Testing
  22. if GetDepend('LIBSODIUM_USING_TESTING_CORE'):
  23. src += Glob('test/default/core1.c')
  24. if GetDepend('LIBSODIUM_USING_TESTING_GENERIC_HASH'):
  25. src += Glob('test/default/generichash.c')
  26. if GetDepend('LIBSODIUM_USING_TESTING_SHORT_HASH'):
  27. src += Glob('test/default/shorthash.c')
  28. if GetDepend('LIBSODIUM_USING_TESTING_HASH'):
  29. src += Glob('test/default/hash.c')
  30. path = [cwd + '/libsodium/include']
  31. path += [cwd + '/libsodium/include/sodium']
  32. path += [cwd + '/libsodium/include/sodium/private']
  33. LOCAL_CCFLAGS = ''
  34. if rtconfig.CROSS_TOOL == 'gcc':
  35. LOCAL_CCFLAGS += ' -Wno-unknown-pragmas -Wno-unused-function'
  36. group = DefineGroup('libsodium', src, depend = ['PKG_USING_LIBSODIUM'], CPPPATH = path, CPPDEFINES=['CONFIGURED=1'], LOCAL_CCFLAGS = LOCAL_CCFLAGS)
  37. Return('group')