Home | History | Annotate | Download | only in third_party
      1 #!/bin/bash
      2 # Copyright 2015 The Weave Authors. All rights reserved.
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 
      6 # Make gtest and gmock.
      7 cd $(dirname "$0")
      8 THIRD_PARTY=$(pwd)
      9 
     10 mkdir -p include lib
     11 
     12 rm -rf $THIRD_PARTY/googletest
     13 git clone https://github.com/google/googletest.git || exit 1
     14 cd googletest
     15 
     16 # gtest is in process of changing of dir structure and it has broken build
     17 # files. So this is temporarily workaround to fix that.
     18 git reset --hard 82b11b8cfcca464c2ac74b623d04e74452e74f32
     19 mv googletest googlemock/gtest
     20 
     21 cd $THIRD_PARTY/googletest/googlemock/gtest/make || exit 1
     22 make gtest.a || exit 1
     23 cp -rf ../include/* $THIRD_PARTY/include/ || exit 1
     24 cp -rf gtest.a $THIRD_PARTY/lib/ || exit 1
     25 
     26 cd $THIRD_PARTY/googletest/googlemock/make || exit 1
     27 make gmock.a || exit 1
     28 cp -rf ../include/* $THIRD_PARTY/include/ || exit 1
     29 cp -rf gmock.a $THIRD_PARTY/lib/ || exit 1
     30 
     31 rm -rf $THIRD_PARTY/googletest
     32