Skip to content

Commit 473479c

Browse files
committed
Added x86 builds for casablanca on Android
1 parent 7c4a39f commit 473479c

File tree

5 files changed

+69
-20
lines changed

5 files changed

+69
-20
lines changed

Build_android/configure.sh

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ then
237237
-DANDROID_GOLD_LINKER=OFF \
238238
-DCMAKE_BUILD_TYPE=Debug \
239239
-DANDROID_NDK="${ANDROID_NDK}"
240-
make -j 3
240+
make -j 1
241241
)
242242

243243
(
@@ -253,7 +253,39 @@ then
253253
-DANDROID_NATIVE_API_LEVEL=android-9 \
254254
-DANDROID_GOLD_LINKER=OFF \
255255
-DCMAKE_BUILD_TYPE=Release
256-
make -j 3
256+
make -j 1
257+
)
258+
259+
(
260+
mkdir -p build.x86.debug
261+
cd build.x86.debug
262+
cmake "$DIR/../Release/" \
263+
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
264+
-DANDROID_ABI=x86 \
265+
-DANDROID_TOOLCHAIN_NAME=x86-clang3.4 \
266+
-DANDROID_STL=none \
267+
-DANDROID_STL_FORCE_FEATURES=ON \
268+
-DANDROID_NATIVE_API_LEVEL=android-9 \
269+
-DANDROID_GOLD_LINKER=OFF \
270+
-DCMAKE_BUILD_TYPE=Debug \
271+
-DANDROID_NDK="${ANDROID_NDK}"
272+
make -j 1
273+
)
274+
275+
(
276+
mkdir -p build.x86.release
277+
cd build.x86.release
278+
cmake "$DIR/../Release/" \
279+
-DCMAKE_TOOLCHAIN_FILE=../android-cmake/android.toolchain.cmake \
280+
-DANDROID_ABI=x86 \
281+
-DANDROID_TOOLCHAIN_NAME=x86-clang3.4 \
282+
-DANDROID_STL=none \
283+
-DANDROID_STL_FORCE_FEATURES=ON \
284+
-DANDROID_NDK="${ANDROID_NDK}" \
285+
-DANDROID_NATIVE_API_LEVEL=android-9 \
286+
-DANDROID_GOLD_LINKER=OFF \
287+
-DCMAKE_BUILD_TYPE=Release
288+
make -j 1
257289
)
258290
)
259291
fi

Release/CMakeLists.txt

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(IOS)
2020
"${IOS_SOURCE_DIR}/openssl/lib/libssl.a"
2121
)
2222

23-
# The cxx_flags must be set here, because the ios-cmake toolchain file unfortunately sets "-headerpad_max_install_names" which is not a valid clang flag.
23+
# The cxx_flags must be reset here, because the ios-cmake toolchain file unfortunately sets "-headerpad_max_install_names" which is not a valid clang flag.
2424
set(CMAKE_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden")
2525

2626
set(BUILD_SHARED_LIBS OFF)
@@ -29,18 +29,36 @@ if(IOS)
2929
elseif(ANDROID)
3030
set(Boost_COMPILER "-clang")
3131
set(Boost_USE_STATIC_LIBS ON)
32-
set(BOOST_ROOT "${CMAKE_BINARY_DIR}/../Boost-for-Android/build")
33-
set(BOOST_LIBRARYDIR "${CMAKE_BINARY_DIR}/../Boost-for-Android/build/lib")
32+
if(ARM)
33+
set(BOOST_ROOT "${CMAKE_BINARY_DIR}/../Boost-for-Android/build")
34+
set(BOOST_LIBRARYDIR "${CMAKE_BINARY_DIR}/../Boost-for-Android/build/lib")
35+
else()
36+
set(BOOST_ROOT "${CMAKE_BINARY_DIR}/../Boost-for-Android-x86/build")
37+
set(BOOST_LIBRARYDIR "${CMAKE_BINARY_DIR}/../Boost-for-Android-x86/build/lib")
38+
endif()
3439
find_host_package(Boost 1.55 EXACT REQUIRED COMPONENTS random system thread locale filesystem chrono atomic)
3540

3641
# find_package(Threads REQUIRED)
3742
set(OPENSSL_FOUND 1)
38-
set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/include")
39-
set(OPENSSL_LIBRARIES
40-
"${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libssl.a"
41-
"${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libcrypto.a"
42-
)
43-
set(LIBCXX_STL "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/thumb/libgnustl_static.a")
43+
if(ARM)
44+
set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/include")
45+
set(OPENSSL_LIBRARIES
46+
"${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libssl.a"
47+
"${CMAKE_BINARY_DIR}/../openssl/armeabi-v7a/lib/libcrypto.a"
48+
)
49+
else()
50+
set(OPENSSL_INCLUDE_DIR "${CMAKE_BINARY_DIR}/../openssl/x86/include")
51+
set(OPENSSL_LIBRARIES
52+
"${CMAKE_BINARY_DIR}/../openssl/x86/lib/libssl.a"
53+
"${CMAKE_BINARY_DIR}/../openssl/x86/lib/libcrypto.a"
54+
)
55+
endif()
56+
57+
if(ARM)
58+
set(LIBCXX_STL "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/thumb/libgnustl_static.a")
59+
else()
60+
set(LIBCXX_STL "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86/thumb/libgnustl_static.a")
61+
endif()
4462
set(ANDROID_STL_FLAGS
4563
# pthread
4664
${LIBCXX_STL}
@@ -52,7 +70,7 @@ elseif(ANDROID)
5270
# -nodefaultlibs
5371
)
5472

55-
set(BUILD_SHARED_LIBS ON)
73+
option(BUILD_SHARED_LIBS "Build shared Libraries." OFF)
5674
set(BUILD_SAMPLES OFF)
5775
option(BUILD_TESTS "Build tests." ON)
5876
elseif(UNIX) # This includes OSX

Release/src/websockets/client/ws_client.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,11 @@ namespace details
9494
// Utility function to build up error string based on error code and location.
9595
static std::string build_error_msg(const std::error_code &ec, const std::string &location)
9696
{
97-
std::string msg(location);
98-
msg.append(": ");
99-
msg.append(std::to_string(ec.value()));
100-
msg.append(": ");
101-
msg.append(ec.message());
102-
return msg;
97+
std::stringstream ss;
98+
ss << location
99+
<< ": " << ec.value()
100+
<< ": " << ec.message();
101+
return ss.str();
103102
}
104103

105104
static utility::string_t g_subProtocolHeader(_XPLATSTR("Sec-WebSocket-Protocol"));

Release/tests/common/TestRunner/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set(TR_SOURCES
1010

1111
add_definitions(-DDESKTOP_TEST_RUNNER)
1212

13-
if(NOT IOS)
13+
if(NOT IOS AND NOT ANDROID)
1414
if(BUILD_SHARED_LIBS)
1515
add_executable(test_runner
1616
test_runner.cpp

Release/tests/functional/http/utilities/test_http_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ class _test_http_server
494494
typename web::http::experimental::listener::http_listener m_listener;
495495
pplx::extensibility::critical_section_t m_lock;
496496
std::vector<pplx::task_completion_event<test_request*>> m_requests;
497-
std::atomic<unsigned long long> m_last_request_id;
497+
std::atomic<unsigned long> m_last_request_id;
498498

499499
std::unordered_map<unsigned long long, web::http::http_request> m_responding_requests;
500500

0 commit comments

Comments
 (0)