gtest.parts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################
  16. Import('*')
  17. env.PartVersion("1.7.0")
  18. env.PartName("gtest")
  19. #files
  20. cpp_files=[
  21. 'gtest-all.cc'
  22. ]
  23. #includes to install
  24. install_headers = Glob('*.h')
  25. parts_file = ['gtest.parts']
  26. license_file = ['LICENSE']
  27. makefile = ['Makefile']
  28. if 'install_package' in env['MODE']:
  29. env.InstallTopLevel(cpp_files,sub_dir='ext/gtest')
  30. env.InstallTopLevel(install_headers,sub_dir='ext/gtest')
  31. env.InstallTopLevel(parts_file,sub_dir='ext/gtest')
  32. env.InstallTopLevel(license_file,sub_dir='ext/gtest')
  33. env.InstallTopLevel(makefile,sub_dir='ext/gtest')
  34. else:
  35. env.Append(CPPPATH=[AbsDir('..')])
  36. #defines
  37. env.Append(CPPDEFINES = ['GTEST_HAS_PTHREAD=0',
  38. '_VARIADIC_MAX=10'])
  39. env.ExportCPPDEFINES(['GTEST_HAS_PTHREAD=0',
  40. '_VARIADIC_MAX=10'])
  41. outputs = env.Library('${PART_NAME}', cpp_files)
  42. sdk_outs = env.Sdk(outputs)
  43. env.SdkInclude(install_headers, sub_dir='${PART_NAME}')