SConscript revision 12312
112312Sgabeblack@google.com# Copyright 2017 Google Inc.
212312Sgabeblack@google.com#
312312Sgabeblack@google.com# Redistribution and use in source and binary forms, with or without
412312Sgabeblack@google.com# modification, are permitted provided that the following conditions are
512312Sgabeblack@google.com# met: redistributions of source code must retain the above copyright
612312Sgabeblack@google.com# notice, this list of conditions and the following disclaimer;
712312Sgabeblack@google.com# redistributions in binary form must reproduce the above copyright
812312Sgabeblack@google.com# notice, this list of conditions and the following disclaimer in the
912312Sgabeblack@google.com# documentation and/or other materials provided with the distribution;
1012312Sgabeblack@google.com# neither the name of the copyright holders nor the names of its
1112312Sgabeblack@google.com# contributors may be used to endorse or promote products derived from
1212312Sgabeblack@google.com# this software without specific prior written permission.
1312312Sgabeblack@google.com#
1412312Sgabeblack@google.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1512312Sgabeblack@google.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1612312Sgabeblack@google.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1712312Sgabeblack@google.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1812312Sgabeblack@google.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1912312Sgabeblack@google.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2012312Sgabeblack@google.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2112312Sgabeblack@google.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2212312Sgabeblack@google.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2312312Sgabeblack@google.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2412312Sgabeblack@google.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2512312Sgabeblack@google.com
2612312Sgabeblack@google.comImport('main')
2712312Sgabeblack@google.com
2812312Sgabeblack@google.com# The root of the build directory.
2912312Sgabeblack@google.combuild = Dir('.')
3012312Sgabeblack@google.com# The root of the original directory.
3112312Sgabeblack@google.combase = build.srcdir
3212312Sgabeblack@google.com# Include files from the original directory.
3312312Sgabeblack@google.cominclude = base.Dir('include')
3412312Sgabeblack@google.com# Use source files from the build directory so build products end up there.
3512312Sgabeblack@google.comsrc = Dir('src')
3612312Sgabeblack@google.com
3712312Sgabeblack@google.commain.Append(CPPPATH=[include])
3812312Sgabeblack@google.commain.Append(LIBPATH=[build])
3912312Sgabeblack@google.com
4012312Sgabeblack@google.comenv = main.Clone(CPPFLAGS='-g -Wall -Wextra -pthread'
4112312Sgabeblack@google.com                          ' -Wno-undef -isystem %s' % include)
4212312Sgabeblack@google.comenv.Append(CPPPATH=[base])
4312312Sgabeblack@google.com
4412312Sgabeblack@google.comgtest_all = env.Object(src.File('gtest-all.cc'))
4512312Sgabeblack@google.comgtest_main = env.StaticLibrary(
4612312Sgabeblack@google.com    target='gtest_main', source=[gtest_all, src.File('gtest_main.cc')])
4712312Sgabeblack@google.com
4812312Sgabeblack@google.commain['GTEST_LIBS'] = ['gtest_main', 'pthread']
4912312Sgabeblack@google.commain['GTEST_CPPFLAGS'] = '-pthread -Wno-undef -isystem %s' % include.abspath
50