Skip to content

Commit f15910c

Browse files
committed
Merge pull request microsoft#65 from snikulov/linux_build_fix
Fixed build on CentOS 7 Linux
2 parents 3070ca2 + 8b6f832 commit f15910c

File tree

4 files changed

+16
-23
lines changed

4 files changed

+16
-23
lines changed

Release/CMakeLists.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ enable_testing()
77
set(WARNINGS)
88
set(ANDROID_STL_FLAGS)
99

10+
option(WERROR "Threat Warnings as Errors" ON)
11+
1012
# Platform (not compiler) specific settings
1113
if(IOS)
1214
set(IOS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../Build_iOS")
@@ -73,7 +75,7 @@ elseif(ANDROID)
7375
set(BUILD_SAMPLES OFF)
7476
option(BUILD_TESTS "Build tests." ON)
7577
elseif(UNIX) # This includes OSX
76-
find_package(Boost REQUIRED COMPONENTS random chrono system thread regex filesystem)
78+
find_package(Boost 1.54 REQUIRED COMPONENTS random chrono system thread regex filesystem)
7779
find_package(Threads REQUIRED)
7880
if(APPLE AND NOT OPENSSL_ROOT_DIR)
7981
# Prefer a homebrew version of OpenSSL over the one in /usr/lib
@@ -190,14 +192,7 @@ endif()
190192

191193
set(Casablanca_LIBRARY ${LIB}cpprest)
192194
set(Casablanca_LIBRARIES ${Casablanca_LIBRARY}
193-
${Boost_FILESYSTEM_LIBRARY}
194-
${Boost_SYSTEM_LIBRARY}
195-
${Boost_THREAD_LIBRARY}
196-
${Boost_ATOMIC_LIBRARY}
197-
${Boost_CHRONO_LIBRARY}
198-
${Boost_RANDOM_LIBRARY}
199-
${Boost_REGEX_LIBRARY}
200-
${Boost_FRAMEWORK})
195+
${Boost_LIBRARIES})
201196

202197
# Everything in the project needs access to the casablanca include directories
203198
include_directories(${Casablanca_INCLUDE_DIRS})

Release/src/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ if(UNIX)
5353
else()
5454
list(APPEND SOURCES pplx/pplxlinux.cpp)
5555
endif()
56-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -Werror -pedantic")
56+
57+
if(WERROR)
58+
set(WARNINGS "${WARNINGS} -Werror")
59+
endif()
60+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -pedantic")
5761
elseif(WIN32)
5862
set(SOURCES
5963
${SOURCES_COMMON}

Release/tests/common/TestRunner/CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ if(NOT IOS AND NOT ANDROID)
1717
)
1818

1919
target_link_libraries(test_runner
20-
${Boost_FRAMEWORK}
21-
${Boost_SYSTEM_LIBRARY}
22-
${Boost_FILESYSTEM_LIBRARY}
20+
${Boost_LIBRARIES}
2321
${LIB}unittestpp
2422
${CMAKE_DL_LIBS}
2523
)
@@ -31,9 +29,7 @@ if(NOT IOS AND NOT ANDROID)
3129
)
3230

3331
target_link_libraries(test_runner
34-
${Boost_FRAMEWORK}
35-
${Boost_SYSTEM_LIBRARY}
36-
${Boost_FILESYSTEM_LIBRARY}
32+
${Boost_LIBRARIES}
3733
${LIB}unittestpp
3834
${CMAKE_DL_LIBS}
3935
-Wl,-force_load
@@ -64,9 +60,7 @@ if(NOT IOS AND NOT ANDROID)
6460
)
6561

6662
target_link_libraries(test_runner
67-
${Boost_FRAMEWORK}
68-
${Boost_SYSTEM_LIBRARY}
69-
${Boost_FILESYSTEM_LIBRARY}
63+
${Boost_LIBRARIES}
7064
${LIB}unittestpp
7165
${CMAKE_DL_LIBS}
7266
-Wl,--whole-archive

Release/tests/functional/http/client/proxy_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TEST_FIXTURE(uri_address, auto_discovery_proxy)
4646
p_request->reply(200);
4747
});
4848
http_client_config config;
49-
49+
5050
config.set_proxy(web_proxy::use_auto_discovery);
5151
VERIFY_IS_FALSE(config.proxy().is_disabled());
5252
VERIFY_IS_FALSE(config.proxy().is_specified());
@@ -63,7 +63,7 @@ TEST_FIXTURE(uri_address, disabled_proxy)
6363
http_asserts::assert_test_request_equals(p_request, methods::PUT, U("/"), U("text/plain"), U("sample data"));
6464
p_request->reply(status_codes::OK);
6565
});
66-
66+
6767
http_client_config config;
6868
config.set_proxy(web_proxy(web_proxy::disabled));
6969
VERIFY_IS_TRUE(config.proxy().is_disabled());
@@ -97,13 +97,13 @@ TEST_FIXTURE(uri_address, no_proxy_options_on_winrt)
9797
web_proxy proxy(u);
9898
VERIFY_IS_TRUE(proxy.is_specified());
9999
VERIFY_ARE_EQUAL(u, proxy.address());
100-
credentials cred(U("artur"), U("fred")); // relax, this is not my real password
100+
web::credentials cred(U("artur"), U("fred")); // relax, this is not my real password
101101
proxy.set_credentials(cred);
102102

103103
http_client_config config;
104104
config.set_proxy(proxy);
105105

106-
// Access to this server will succeed because the first request will not be challenged and hence
106+
// Access to this server will succeed because the first request will not be challenged and hence
107107
// my bogus credentials will not be supplied.
108108
http_client client(U("http://www.microsoft.com"), config);
109109

0 commit comments

Comments
 (0)