41
41
$(error Expected value of THREADING to be single/pthread/std)
42
42
endif
43
43
44
+ ifneq "$(THREADING ) " "std"
45
+ override POSIX_SUPPORT = "0"
46
+ endif
47
+
44
48
# Required flag customizations.
45
49
override CPPFLAGS += -Iinclude
46
50
override CPPFLAGS += -I$(GTEST_DIR ) /include
@@ -67,6 +71,10 @@ PLATFORM_HEADERS := \
67
71
include/wtf/platform/platform_myriad2sparc_impl.h \
68
72
include/wtf/platform/platform_myriad2sparc_inl.h
69
73
74
+ ifeq "$(POSIX_SUPPORT ) " "1"
75
+ LIBRARY_HEADERS += include/wtf/posix_utils.h
76
+ endif
77
+
70
78
ALL_HEADERS := $(LIBRARY_HEADERS ) $(PLATFORM_HEADERS )
71
79
72
80
LIBRARY_SOURCES := \
@@ -81,6 +89,11 @@ TEST_SOURCES := \
81
89
runtime_test.cc \
82
90
threaded_torture_test.cc
83
91
92
+ ifeq "$(POSIX_SUPPORT ) " "1"
93
+ LIBRARY_SOURCES += posix_utils.cc
94
+ TEST_SOURCES += posix_utils_test.cc
95
+ endif
96
+
84
97
LIBRARY_OBJECTS := $(LIBRARY_SOURCES:%.cc=%.o )
85
98
86
99
.PHONY : clean all test
@@ -113,7 +126,13 @@ clean:
113
126
$(wildcard tmp* .wtf-trace)
114
127
115
128
# ## TESTING.
129
+ ifneq "$(POSIX_SUPPORT ) " "1"
116
130
test : buffer_test macros_test runtime_test threaded_torture_test
131
+ else
132
+ test : buffer_test macros_test runtime_test threaded_torture_test posix_utils_test
133
+ @echo " Running posix_utils_test"
134
+ ./posix_utils_test
135
+ endif
117
136
@echo "Running buffer_test"
118
137
./buffer_test
119
138
@echo "Running macros_test"
@@ -138,6 +157,9 @@ macros_test: macros_test.o gtest.o libwtf.a
138
157
runtime_test : runtime_test.o gtest.o libwtf.a
139
158
$(CXX ) $(CXXFLAGS ) $(CPPFLAGS ) -o $@ $+ $(LDLIBS )
140
159
160
+ posix_utils_test : posix_utils_test.o gtest.o libwtf.a
161
+ $(CXX ) $(CXXFLAGS ) $(CPPFLAGS ) -o $@ $+ $(LDLIBS )
162
+
141
163
# ## THREADED TORTURE TEST
142
164
ifneq "$(THREADING ) " "single"
143
165
threaded_torture_test : threaded_torture_test.o libwtf.a
0 commit comments