Skip to content

Commit 5a34648

Browse files
committed
Updated build scripts to ensure the minimum Boost version is 1.45.
1 parent 553eced commit 5a34648

File tree

8 files changed

+35
-63
lines changed

8 files changed

+35
-63
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
cmake_minimum_required(VERSION 2.6)
77
project(CPP-NETLIB)
8-
find_package( Boost 1.41.0 )
8+
find_package( Boost 1.45.0 )
99
find_package( OpenSSL )
1010
find_package( Threads )
1111
set(CMAKE_VERBOSE_MAKEFILE true)
@@ -32,8 +32,8 @@ endif()
3232

3333
add_subdirectory(libs/network/src)
3434
add_subdirectory(libs/network/test)
35-
if (NOT MSVC)
36-
add_subdirectory(libs/mime/test)
37-
endif(NOT MSVC)
35+
#if (NOT MSVC)
36+
# add_subdirectory(libs/mime/test)
37+
#endif(NOT MSVC)
3838
add_subdirectory(libs/network/example)
3939

boost/network/uri/uri.hpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -303,31 +303,6 @@ bool operator == (const uri &lhs, const uri &rhs) {
303303
}
304304
} // namespace uri
305305
} // namespace network
306-
307-
inline
308-
network::uri::uri::iterator begin(network::uri::uri &uri_) {
309-
return uri_.begin();
310-
}
311-
312-
inline
313-
network::uri::uri::iterator end(network::uri::uri &uri_) {
314-
return uri_.end();
315-
}
316-
317-
inline
318-
network::uri::uri::const_iterator begin(const network::uri::uri &uri_) {
319-
return uri_.begin();
320-
}
321-
322-
inline
323-
network::uri::uri::const_iterator end(const network::uri::uri &uri_) {
324-
return uri_.end();
325-
}
326-
327-
inline
328-
void swap(network::uri::uri &lhs, network::uri::uri &rhs) {
329-
lhs.swap(rhs);
330-
}
331306
} // namespace boost
332307

333308

libs/network/build/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include_directories(${CPP-NETLIB_SOURCE_DIR})
2-
find_package( Boost 1.43.0 COMPONENTS unit_test_framework system regex thread filesystem )
2+
find_package( Boost 1.45.0 COMPONENTS unit_test_framework system regex thread filesystem )
33

44
add_library(cppnetlib-uri STATIC ${CPP-NETLIB_SOURCE_DIR}/libs/network/src/parse_uri_impl.cpp)
55
add_library(cppnetlib-server-parsers STATIC ${CPP-NETLIB_SOURCE_DIR}/libs/network/src/server_request_parsers_impl.cpp)

libs/network/example/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# http://www.boost.org/LICENSE_1_0.txt)
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR})
7-
find_package( Boost 1.41.0 COMPONENTS program_options system regex date_time thread filesystem )
7+
find_package( Boost 1.45.0 COMPONENTS program_options system regex date_time thread filesystem )
88
find_package( OpenSSL )
99
find_package( Threads )
1010

@@ -20,23 +20,26 @@ endif (OPENSSL_FOUND)
2020
if (Boost_FOUND)
2121
add_executable(http_client http_client.cpp)
2222
add_dependencies(http_client cppnetlib-uri)
23-
target_link_libraries(http_client ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
23+
target_link_libraries(http_client ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri cppnetlib-client-connections)
2424
set_target_properties(http_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
2525
if (OPENSSL_FOUND)
2626
target_link_libraries(http_client ${OPENSSL_LIBRARIES})
2727
endif (OPENSSL_FOUND)
2828

2929
add_executable(simple_wget simple_wget.cpp)
3030
add_dependencies(simple_wget cppnetlib-uri)
31-
target_link_libraries(simple_wget ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
31+
target_link_libraries(simple_wget ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri cppnetlib-client-connections)
3232
set_target_properties(simple_wget PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
3333
if (OPENSSL_FOUND)
3434
target_link_libraries(simple_wget ${OPENSSL_LIBRARIES})
3535
endif (OPENSSL_FOUND)
3636

3737
add_executable(one_liner http/one_liner.cpp)
38-
target_link_libraries(one_liner ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
38+
target_link_libraries(one_liner ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri cppnetlib-client-connections)
3939
set_target_properties(one_liner PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/example)
40+
if (OPENSSL_FOUND)
41+
target_link_libraries(one_liner ${OPENSSL_LIBRARIES})
42+
endif (OPENSSL_FOUND)
4043

4144
add_executable(hello_world_server http/hello_world_server.cpp)
4245
target_link_libraries(hello_world_server ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )

libs/network/example/simple_wget.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ namespace uri = boost::network::uri;
2626

2727

2828
namespace {
29-
template <
30-
class Tag
31-
>
32-
std::string get_filename(const uri::basic_uri<Tag> &url) {
29+
std::string get_filename(const uri::uri &url) {
3330
std::string path = uri::path(url);
3431
std::size_t index = path.find_last_of('/');
3532
std::string filename = path.substr(index + 1);

libs/network/test/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# http://www.boost.org/LICENSE_1_0.txt)
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR})
7-
find_package( Boost 1.41.0 COMPONENTS unit_test_framework system regex date_time thread filesystem )
7+
find_package( Boost 1.45.0 COMPONENTS unit_test_framework system regex date_time thread filesystem )
88
set(Boost_USE_STATIC_LIBS ON)
99
set(Boost_USE_MULTITHREADED ON)
1010

@@ -23,9 +23,6 @@ if (Boost_FOUND)
2323
PROPERTIES COMPILE_FLAGS "-Wall")
2424
add_executable(cpp-netlib-${test} ${test}.cpp)
2525
add_dependencies(cpp-netlib-${test} cppnetlib-uri)
26-
27-
# add_dependencies(cpp-netlib-${test} cppnetlib-uri)
28-
# target_link_libraries(cpp-netlib-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
2926
target_link_libraries(cpp-netlib-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-uri)
3027
if (OPENSSL_FOUND)
3128
target_link_libraries(cpp-netlib-${test} ${OPENSSL_LIBRARIES})

libs/network/test/http/CMakeLists.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# http://www.boost.org/LICENSE_1_0.txt)
66

77
include_directories(${CPP-NETLIB_SOURCE_DIR})
8-
find_package( Boost 1.43.0 REQUIRED unit_test_framework system regex thread filesystem )
8+
find_package( Boost 1.45.0 REQUIRED unit_test_framework system regex thread filesystem )
99
find_package( OpenSSL )
1010

1111
if (OPENSSL_FOUND)
@@ -86,24 +86,24 @@ if (Boost_FOUND)
8686
math (EXPR PORT "${PORT} + 1")
8787
endforeach (test)
8888

89-
set ( INLINED_TESTS
90-
client_include_inlined
91-
server_include_inlined
92-
)
93-
foreach ( test ${INLINED_TESTS} )
94-
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
95-
set_source_files_properties(${test}.cpp
96-
PROPERTIES COMPILE_FLAGS "-Wall")
97-
endif()
98-
add_executable(cpp-netlib-http-inlined-${test} ${test}.cpp)
99-
target_link_libraries(cpp-netlib-http-inlined-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
100-
if (OPENSSL_FOUND)
101-
target_link_libraries(cpp-netlib-http-inlined-${test} ${OPENSSL_LIBRARIES})
102-
endif()
103-
set_target_properties(cpp-netlib-http-inlined-${test}
104-
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests)
105-
add_test(cpp-netlib-http-inlined-${test}
106-
${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-http-inlined-${test})
107-
endforeach (test)
89+
#set ( INLINED_TESTS
90+
# client_include_inlined
91+
# server_include_inlined
92+
# )
93+
#foreach ( test ${INLINED_TESTS} )
94+
# if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
95+
# set_source_files_properties(${test}.cpp
96+
# PROPERTIES COMPILE_FLAGS "-Wall")
97+
# endif()
98+
# add_executable(cpp-netlib-http-inlined-${test} ${test}.cpp)
99+
# target_link_libraries(cpp-netlib-http-inlined-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
100+
# if (OPENSSL_FOUND)
101+
# target_link_libraries(cpp-netlib-http-inlined-${test} ${OPENSSL_LIBRARIES})
102+
# endif()
103+
# set_target_properties(cpp-netlib-http-inlined-${test}
104+
# PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR}/tests)
105+
# add_test(cpp-netlib-http-inlined-${test}
106+
# ${CPP-NETLIB_BINARY_DIR}/tests/cpp-netlib-http-inlined-${test})
107+
#endforeach (test)
108108

109109
endif()

libs/network/test/uri/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# http://www.boost.org/LICENSE_1_0.txt)
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR})
7-
find_package( Boost 1.41.0 COMPONENTS unit_test_framework system regex date_time filesystem )
7+
find_package( Boost 1.45.0 COMPONENTS unit_test_framework system regex date_time filesystem )
88
find_package( OpenSSL )
99
find_package( Threads )
1010

0 commit comments

Comments
 (0)