1############################################################################
2# Copyright 2016-2018 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############################################################################
16Import('*')
17
18env.PartVersion("1.8.0")
19env.PartName("gtest")
20
21#files
22cpp_files=['gtest-all.cc']
23
24#includes to install
25install_headers = Glob('*.h')
26
27parts_file = ['gtest.parts']
28license_file = ['LICENSE']
29makefile = ['Makefile']
30
31if 'install_package' in env['MODE']:
32    env.InstallTopLevel(cpp_files,sub_dir='ext/gtest')
33    env.InstallTopLevel(install_headers,sub_dir='ext/gtest')
34    env.InstallTopLevel(parts_file,sub_dir='ext/gtest')
35    env.InstallTopLevel(license_file,sub_dir='ext/gtest')
36    env.InstallTopLevel(makefile,sub_dir='ext/gtest')
37else:
38    env.Append(CPPPATH=[AbsDir('..')])
39
40
41    #defines
42    env.Append(CPPDEFINES = ['GTEST_HAS_PTHREAD=0',
43                             '_VARIADIC_MAX=10',
44                             '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'])
45    env.ExportCPPDEFINES(['GTEST_HAS_PTHREAD=0',
46                          '_VARIADIC_MAX=10',
47                          '_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING'])
48
49    outputs = env.Library('${PART_NAME}', cpp_files)
50    sdk_outs = env.Sdk(outputs)
51
52    env.SdkInclude(install_headers, sub_dir='${PART_NAME}')
53