Commit af8c7ee4 authored by Jisyang Mwo's avatar Jisyang Mwo

Makefile: include gtest headers with '-isystem'

gtest does not compile successfully with "-Wundef", so the following
error will be produced while running unittests:

$ make run_gc_unittests

<snip>
 /path-to-deps/gtest-1.7.0/include/gtest/internal/gtest-port.h:288:6: error: 'GTEST_OS_WINDOWS' is not defined,
       evaluates to 0 [-Werror,-Wundef]
 #if !GTEST_OS_WINDOWS
     ^
 /path-to-deps/gtest-1.7.0/include/gtest/internal/gtest-port.h:299:5: error: 'GTEST_OS_LINUX_ANDROID' is not defined,
       evaluates to 0 [-Werror,-Wundef]
 #if GTEST_OS_LINUX_ANDROID
     ^
<snip>

The workaround for this issue is using '-isystem'.
parent 97845e0c
......@@ -274,7 +274,7 @@ tags: $(SRCS) $(OPTIONAL_SRCS) $(ALL_HEADERS)
$(ECHO) Computing tags...
$(VERB) ctags $^
$(UNITTEST_SRCS:.cpp=.o): CXXFLAGS := $(CXXFLAGS) -I$(GTEST_DIR)/include
$(UNITTEST_SRCS:.cpp=.o): CXXFLAGS := $(CXXFLAGS) -isystem $(GTEST_DIR)/include
NON_ENTRY_OBJS := $(filter-out jit.o,$(OBJS))
define add_unittest
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment