SConstruct 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. # -*- coding: utf-8; mode: Python -*-
  2. # Top SConstruct for ra-ra
  3. # (c) Daniel Llorens - 2016-2024
  4. # This library is free software; you can redistribute it and/or modify it under
  5. # the terms of the GNU Lesser General Public License as published by the Free
  6. # Software Foundation; either version 3 of the License, or (at your option) any
  7. # later version.
  8. import os, atexit
  9. from os.path import join, abspath
  10. from SCons.Script import GetBuildFailures
  11. import imp
  12. # Make sure to disable (-no-sanitize) for benchmarks.
  13. AddOption('--no-sanitize', default=True, action='store_false', dest='sanitize', help='Disable sanitizer flags.')
  14. AddOption('--sanitize', default=True, action='store_true', dest='sanitize', help='Enable sanitizer flags.')
  15. AddOption('--blas', default=False, action='store_true', dest='use_blas', help='Try to use BLAS (benchmarks only).')
  16. top = {'skip_summary': True, 'sanitize': GetOption('sanitize'), 'use_blas': GetOption('use_blas')}
  17. Export('top');
  18. ra = imp.load_source('ra', 'config/ra.py')
  19. SConscript('test/SConstruct', 'top')
  20. SConscript('bench/SConstruct', 'top')
  21. SConscript('examples/SConstruct', 'top')
  22. SConscript('box/SConstruct', 'top')
  23. # SConscript('docs/SConstruct', 'top') # TODO run from docs, otherwise makeinfo writes empty files (??)
  24. Default(['test', 'bench', 'examples']) # exclude box
  25. atexit.register(lambda: ra.print_summary(GetBuildFailures, 'ra-ra'))