4141$(error Expected value of THREADING to be single/pthread/std)
4242endif
4343
44+ ifneq "$(THREADING ) " "std"
45+ override POSIX_SUPPORT = "0"
46+ endif
47+
4448# Required flag customizations.
4549override CPPFLAGS += -Iinclude
4650override CPPFLAGS += -I$(GTEST_DIR ) /include
@@ -67,6 +71,10 @@ PLATFORM_HEADERS := \
6771 include/wtf/platform/platform_myriad2sparc_impl.h \
6872 include/wtf/platform/platform_myriad2sparc_inl.h
6973
74+ ifeq "$(POSIX_SUPPORT ) " "1"
75+ LIBRARY_HEADERS += include/wtf/posix_utils.h
76+ endif
77+
7078ALL_HEADERS := $(LIBRARY_HEADERS ) $(PLATFORM_HEADERS )
7179
7280LIBRARY_SOURCES := \
@@ -81,6 +89,11 @@ TEST_SOURCES := \
8189 runtime_test.cc \
8290 threaded_torture_test.cc
8391
92+ ifeq "$(POSIX_SUPPORT ) " "1"
93+ LIBRARY_SOURCES += posix_utils.cc
94+ TEST_SOURCES += posix_utils_test.cc
95+ endif
96+
8497LIBRARY_OBJECTS := $(LIBRARY_SOURCES:%.cc=%.o )
8598
8699.PHONY : clean all test
@@ -113,7 +126,13 @@ clean:
113126 $(wildcard tmp* .wtf-trace)
114127
115128# ## TESTING.
129+ ifneq "$(POSIX_SUPPORT ) " "1"
116130test : 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
117136 @echo "Running buffer_test"
118137 ./buffer_test
119138 @echo "Running macros_test"
@@ -138,6 +157,9 @@ macros_test: macros_test.o gtest.o libwtf.a
138157runtime_test : runtime_test.o gtest.o libwtf.a
139158 $(CXX ) $(CXXFLAGS ) $(CPPFLAGS ) -o $@ $+ $(LDLIBS )
140159
160+ posix_utils_test : posix_utils_test.o gtest.o libwtf.a
161+ $(CXX ) $(CXXFLAGS ) $(CPPFLAGS ) -o $@ $+ $(LDLIBS )
162+
141163# ## THREADED TORTURE TEST
142164ifneq "$(THREADING ) " "single"
143165threaded_torture_test : threaded_torture_test.o libwtf.a
0 commit comments