Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit a03d59e

Browse files
ZhennanQinlanking520
authored andcommitted
Fix gtest build (#13926)
1 parent 4c7fc7f commit a03d59e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/cpp/unittest.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS)
2525
GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \
2626
$(GTEST_DIR)/include/gtest/internal/*.h
2727

28+
GTEST_FLAGS=-Wall -Wshadow -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -std=c++11
29+
2830
TEST_CFLAGS = -Itests/cpp/include -Isrc $(CFLAGS)
2931
TEST_LDFLAGS = $(LDFLAGS) -Llib -lmxnet
3032

@@ -36,7 +38,7 @@ endif
3638
.PHONY: runtest testclean
3739

3840
gtest-all.o : $(GTEST_SRCS_)
39-
$(CXX) $(CPPFLAGS) -I$(GTEST_INC) -I$(GTEST_DIR) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc
41+
$(CXX) $(CPPFLAGS) $(GTEST_FLAGS) -I$(GTEST_INC) -I$(GTEST_DIR) $(CXXFLAGS) -c $(GTEST_DIR)/src/gtest-all.cc
4042

4143
gtest.a : gtest-all.o
4244
$(AR) $(ARFLAGS) $@ $^

0 commit comments

Comments
 (0)