Skip to content

Commit 656898a

Browse files
committed
Additional fixes for Apple/Linux
1 parent fac019c commit 656898a

File tree

7 files changed

+35
-8
lines changed

7 files changed

+35
-8
lines changed

Release/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ export BOOST_SYSTEM=boost_system
8282
export BOOST_THREAD=boost_thread
8383
export BOOST_LOCALE=boost_locale
8484
export BOOST_REGEX=boost_regex
85+
export BOOST_FILE_SYSTEM=boost_filesystem
8586
endif
8687
ifeq ($(UNAME),APPLE)
8788
export BOOST_SYSTEM=boost_system-mt
8889
export BOOST_THREAD=boost_thread-mt
8990
export BOOST_LOCALE=boost_locale-mt
9091
export BOOST_REGEX=boost_regex-mt
92+
export BOOST_FILE_SYSTEM=boost_filesystem-mt
9193
endif
9294

9395
tests: src

Release/src/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SOURCES = \
2323
ifeq ($(UNAME),APPLE)
2424
SOURCES += pplx/apple/pplxapple.cpp
2525
else
26-
SOURCES += pplx/apple/pplxlinux.cpp
26+
SOURCES += pplx/linux/pplxlinux.cpp
2727
endif
2828

2929

@@ -86,11 +86,17 @@ PKGCONFIG_CFLAGS = $(shell pkg-config libxml++-2.6 --cflags)
8686
PKGCONFIG_LIBS = $(shell pkg-config libxml++-2.6 --libs) $(shell pkg-config libssl --libs)
8787
endif
8888

89+
ifeq ($(UNAME),APPLE)
90+
PLATFORM_FLAGS = -framework CoreFoundation
91+
endif
92+
ifeq ($(UNAME),LINUX)
93+
PLATFORM_FLAGS = -pthread
94+
endif
95+
8996
#-fpch-deps -MMD not useful with a single monolithic PCH
9097

9198
CXXFLAGS = -fPIC -std=c++11 $(STRICT_BASE_CXXFLAGS) -I../include -I./pch $(WARNINGS) $(PKGCONFIG_CFLAGS)
92-
# Use "mt" version of boost for Apple, and no-mt for Linux
93-
LIBS = $(PKGCONFIG_LIBS) -framework CoreFoundation -l$(BOOST_SYSTEM) -l$(BOOST_THREAD) -l$(BOOST_LOCALE) -l$(BOOST_REGEX) -lstdc++ -lm # these are explicit for clang
99+
LIBS = $(PKGCONFIG_LIBS) $(PLATFORM_FLAGS) -l$(BOOST_SYSTEM) -l$(BOOST_THREAD) -l$(BOOST_LOCALE) -l$(BOOST_REGEX) -lstdc++ -lm # these are explicit for clang
94100
LDFLAGS = $(BASE_LDFLAGS)
95101

96102
ifeq ($(OUTPUT_DIR),)

Release/src/json/json.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ bool json::value::operator==(const json::value &other) const
519519
case Array:
520520
return static_cast<const json::details::_Array*>(this->m_value.get())->is_equal(static_cast<const json::details::_Array*>(other.m_value.get()));
521521
}
522+
UNREACHABLE;
522523
}
523524

524525
web::json::value& web::json::value::operator [] (const utility::string_t &key)

Release/tests/Common/TestRunner/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CXXFLAGS=$(LAX_BASE_CXXFLAGS) -I../../../include/ -I../UnitTestpp/
22
LDFLAGS=-L$(OUTPUT_DIR)
3-
LDLIBS=-l$(BOOST_SYSTEM) -lboost_filesystem-mt -lunittestpp -ldl
3+
LDLIBS=-l$(BOOST_SYSTEM) -l$(BOOST_FILE_SYSTEM) -lunittestpp -ldl
44

55
.PHONY: all
66

Release/tests/Common/UnitTestpp/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
CXXFLAGS += -g -Wall -Wno-unknown-pragmas -W -Winline -ansi -I. -stdlib=libc++ -std=c++11 -fPIC -I$(CASABLANCA_INCLUDE_DIR)
1+
CXXFLAGS += -g -Wall -Wno-unknown-pragmas -W -Winline -ansi -I. -std=c++11 -fPIC -I$(CASABLANCA_INCLUDE_DIR)
2+
3+
ifeq ($(UNAME),APPLE)
4+
CXXFLAGS += -stdlib=libc++
5+
endif
6+
27
# LDFLAGS ?=
38
SED = sed
49
MV = mv
@@ -72,7 +77,7 @@ all: $(lib)
7277

7378
$(lib): $(objects)
7479
@echo Creating $(lib) library...
75-
@$(CXX) -stdlib=libc++ -shared -o $(lib) $(objects) -lstdc++ -lm
80+
@$(CXX) $(CXXFLAGS) -shared -o $(lib) $(objects) -lstdc++ -lm
7681

7782
$(test): $(lib) $(test_objects)
7883
@mkdir -p bin/win32_gcc_static_debug

Release/tests/Common/utilities/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
CXXFLAGS=$(LAX_BASE_CXXFLAGS) -I../../../include/ -I../../Common/UnitTestpp/ -include ../../../include/compat/apple_compat.h -L"$(OUTPUT_DIR)" -fPIC -Iinclude
1+
CXXFLAGS=$(LAX_BASE_CXXFLAGS) -I../../../include/ -I../../Common/UnitTestpp/ -L"$(OUTPUT_DIR)" -fPIC -Iinclude
2+
3+
ifeq ($(UNAME),APPLE)
4+
CXXFLAGS += -include ../../../include/compat/apple_compat.h
5+
else
6+
CXXFLAGS += -include ../../../include/compat/linux_compat.h
7+
endif
28

39
LDLIBS=-lcasablanca -lunittestpp -l$(BOOST_SYSTEM) -l$(BOOST_THREAD) -lpthread -lstdc++
410

Release/tests/Functional/http/utilities/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
CXXFLAGS=$(LAX_BASE_CXXFLAGS) -I. -I$(CASABLANCA_INCLUDE_DIR) -I$(CASABLANCA_TESTS_DIR)/Common/UnitTestpp/ -I$(CASABLANCA_TESTS_DIR)/Common/utilities/include -Iinclude -include compat/apple_compat.h
1+
CXXFLAGS=$(LAX_BASE_CXXFLAGS) -I. -I$(CASABLANCA_INCLUDE_DIR) -I$(CASABLANCA_TESTS_DIR)/Common/UnitTestpp/ -I$(CASABLANCA_TESTS_DIR)/Common/utilities/include -Iinclude
2+
3+
ifeq ($(UNAME),APPLE)
4+
CXXFLAGS += -include compat/apple_compat.h
5+
else
6+
CXXFLAGS += -include compat/linux_compat.h
7+
endif
8+
29
LDFLAGS=-L"$(OUTPUT_DIR)" $(BASE_LDFLAGS)
310
LDLIBS=-lcasablanca -lunittestpp -l$(BOOST_SYSTEM) -l$(BOOST_THREAD) -l$(BOOST_LOCALE) -lpthread -lstdc++
411

0 commit comments

Comments
 (0)