Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build on CentOS 7 Linux #65

Merged
merged 1 commit into from
Feb 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ enable_testing()
set(WARNINGS)
set(ANDROID_STL_FLAGS)

option(WERROR "Threat Warnings as Errors" ON)

# Platform (not compiler) specific settings
if(IOS)
set(IOS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../Build_iOS")
Expand Down Expand Up @@ -73,7 +75,7 @@ elseif(ANDROID)
set(BUILD_SAMPLES OFF)
option(BUILD_TESTS "Build tests." ON)
elseif(UNIX) # This includes OSX
find_package(Boost REQUIRED COMPONENTS random chrono system thread regex filesystem)
find_package(Boost 1.54 REQUIRED COMPONENTS random chrono system thread regex filesystem)
find_package(Threads REQUIRED)
if(APPLE AND NOT OPENSSL_ROOT_DIR)
# Prefer a homebrew version of OpenSSL over the one in /usr/lib
Expand Down Expand Up @@ -190,14 +192,7 @@ endif()

set(Casablanca_LIBRARY ${LIB}cpprest)
set(Casablanca_LIBRARIES ${Casablanca_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_ATOMIC_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_RANDOM_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_FRAMEWORK})
${Boost_LIBRARIES})

# Everything in the project needs access to the casablanca include directories
include_directories(${Casablanca_INCLUDE_DIRS})
Expand Down
6 changes: 5 additions & 1 deletion Release/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ if(UNIX)
else()
list(APPEND SOURCES pplx/pplxlinux.cpp)
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -Werror -pedantic")

if(WERROR)
set(WARNINGS "${WARNINGS} -Werror")
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} -pedantic")
elseif(WIN32)
set(SOURCES
${SOURCES_COMMON}
Expand Down
12 changes: 3 additions & 9 deletions Release/tests/common/TestRunner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ if(NOT IOS AND NOT ANDROID)
)

target_link_libraries(test_runner
${Boost_FRAMEWORK}
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_LIBRARIES}
${LIB}unittestpp
${CMAKE_DL_LIBS}
)
Expand All @@ -31,9 +29,7 @@ if(NOT IOS AND NOT ANDROID)
)

target_link_libraries(test_runner
${Boost_FRAMEWORK}
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_LIBRARIES}
${LIB}unittestpp
${CMAKE_DL_LIBS}
-Wl,-force_load
Expand Down Expand Up @@ -64,9 +60,7 @@ if(NOT IOS AND NOT ANDROID)
)

target_link_libraries(test_runner
${Boost_FRAMEWORK}
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_LIBRARIES}
${LIB}unittestpp
${CMAKE_DL_LIBS}
-Wl,--whole-archive
Expand Down
8 changes: 4 additions & 4 deletions Release/tests/functional/http/client/proxy_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ TEST_FIXTURE(uri_address, auto_discovery_proxy)
p_request->reply(200);
});
http_client_config config;

config.set_proxy(web_proxy::use_auto_discovery);
VERIFY_IS_FALSE(config.proxy().is_disabled());
VERIFY_IS_FALSE(config.proxy().is_specified());
Expand All @@ -63,7 +63,7 @@ TEST_FIXTURE(uri_address, disabled_proxy)
http_asserts::assert_test_request_equals(p_request, methods::PUT, U("/"), U("text/plain"), U("sample data"));
p_request->reply(status_codes::OK);
});

http_client_config config;
config.set_proxy(web_proxy(web_proxy::disabled));
VERIFY_IS_TRUE(config.proxy().is_disabled());
Expand Down Expand Up @@ -97,13 +97,13 @@ TEST_FIXTURE(uri_address, no_proxy_options_on_winrt)
web_proxy proxy(u);
VERIFY_IS_TRUE(proxy.is_specified());
VERIFY_ARE_EQUAL(u, proxy.address());
credentials cred(U("artur"), U("fred")); // relax, this is not my real password
web::credentials cred(U("artur"), U("fred")); // relax, this is not my real password
proxy.set_credentials(cred);

http_client_config config;
config.set_proxy(proxy);

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

Expand Down