gtest.parts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. if 'install_package' in env['MODE']:
  28. env.InstallTopLevel(cpp_files,sub_dir='ext/gtest')
  29. env.InstallTopLevel(install_headers,sub_dir='ext/gtest')
  30. env.InstallTopLevel(parts_file,sub_dir='ext/gtest')
  31. env.InstallTopLevel(license_file,sub_dir='ext/gtest')
  32. else:
  33. env.Append(CPPPATH=[AbsDir('..')])
  34. #defines
  35. env.Append(CPPDEFINES = ['GTEST_HAS_PTHREAD=0',
  36. '_VARIADIC_MAX=10'])
  37. env.ExportCPPDEFINES(['GTEST_HAS_PTHREAD=0',
  38. '_VARIADIC_MAX=10'])
  39. outputs = env.Library('${PART_NAME}', cpp_files)
  40. sdk_outs = env.Sdk(outputs)
  41. env.SdkInclude(install_headers, sub_dir='${PART_NAME}')