math.parts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # pylint:disable=I0011,W0401,W0614,C0103,E0602
  2. ############################################################################
  3. # Copyright 2017 Intel Corporation
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. ############################################################################
  17. """Build configuration for tiny math library.
  18. """
  19. Import('*')
  20. env.PartName('math')
  21. env.DependsOn([
  22. Component('member.tiny_stdlib'),
  23. Component('tinycommon', requires=REQ.HEADERS)
  24. ])
  25. include_files = Pattern(src_dir='.',
  26. includes=['*.h'],
  27. recursive=False).files()
  28. src_files = Pattern(src_dir='src',
  29. includes=['*.c'],
  30. recursive=False).files()
  31. env.Append(CPPPATH='#')
  32. outputs = env.Library('${PART_SHORT_NAME}', src_files)
  33. sdk_outs = env.Sdk(outputs)
  34. env.SdkInclude(include_files, sub_dir='${PART_SHORT_NAME}')
  35. if 'install_lib' in env['MODE'] and 'shared' not in env['MODE']:
  36. env.InstallLib(outputs)
  37. is_utest_build = False
  38. for i in BUILD_TARGETS:
  39. if "utest::" in str(i):
  40. is_utest_build = True
  41. if is_utest_build:
  42. env.Part(parts_file='unittests/utest.parts',
  43. CONFIG=DefaultEnvironment().subst('$CONFIG'))