File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Binaries and build artifacts
22* .o
3+ * .a
34bench
45test-all
56
Original file line number Diff line number Diff line change 11[submodule "deps/url-cpp "]
22 path = deps/url-cpp
33 url = https://github.com/seomoz/url-cpp
4+ [submodule "deps/googletest "]
5+ path = deps/googletest
6+ url = https://github.com/google/googletest/
7+ ignore = untracked
Original file line number Diff line number Diff line change 1+ GTEST_DIR ?= deps/googletest/googletest
2+
13CXX ?= g++
2- CXXOPTS ?= -Wall -Werror -std=c++11 -Iinclude/ -Ideps/url-cpp/include
4+ CXXOPTS ?= -Wall -Werror -std=c++11 -Iinclude/ -Ideps/url-cpp/include -I $( GTEST_DIR ) /include
35DEBUG_OPTS ?= -g -fprofile-arcs -ftest-coverage -O0 -fPIC
46RELEASE_OPTS ?= -O3
5- BINARIES =
7+ BINARIES =
68
79all : test release/librep.o $(BINARIES )
810
11+ $(GTEST_DIR ) /libgtest.a :
12+ g++ -isystem $(GTEST_DIR ) /include -I$(GTEST_DIR ) -pthread -c $(GTEST_DIR ) /src/gtest-all.cc -o $(GTEST_DIR ) /libgtest.a
13+
914# Release libraries
1015release :
1116 mkdir -p release
@@ -42,8 +47,8 @@ test/%.o: test/%.cpp
4247 $(CXX ) $(CXXOPTS ) $(DEBUG_OPTS ) -o $@ -c $<
4348
4449# Tests
45- test-all : test/test-all.o test/test-agent.o test/test-directive.o test/test-robots.o debug/librep.o
46- $(CXX ) $(CXXOPTS ) $( DEBUG_OPTS ) -o $@ $^ -lgtest -lpthread
50+ test-all : test/test-all.o test/test-agent.o test/test-directive.o test/test-robots.o debug/librep.o $( GTEST_DIR ) /libgtest.a
51+ $(CXX ) $(CXXOPTS ) -L $( GTEST_DIR ) $( DEBUG_OPTS ) -o $@ $^ -lpthread
4752
4853# Bench
4954bench : bench.cpp release/librep.o
Original file line number Diff line number Diff line change 55sudo apt-get install -y g++ libgtest-dev cmake python-pip
66
77sudo pip install gcovr==3.2
8-
9- pushd /tmp
10- mkdir -p gtest-build
11- pushd gtest-build
12- cmake -DCMAKE_BUILD_TYPE=RELEASE /usr/src/gtest/
13- make
14- find . -name ' libg*.a' | xargs sudo cp -f --target-directory=/usr/lib/
15- popd
16- popd
You can’t perform that action at this time.
0 commit comments