Skip to content

Commit 8fdaa5a

Browse files
committed
examples are working with shared lib
'cppnetlib-utils-thread_pool' had to be added to the list of linked libraries for 'cppnetlib-http-server'. For the static case this was not a problem but in the shared case symbols were missing. Listing external shared or static libraries in 'add_dependencies' is not required. This CMake command is for adding dependencies between different targets defined by 'add_executable', 'add_library' or 'add_custom_target'.
1 parent a9cc84a commit 8fdaa5a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ find_package( ICU )
1616

1717
if(BUILD_SHARED_LIBS)
1818
set(Boost_USE_STATIC_LIBS OFF)
19-
# TODO/NOTE:
20-
# the examples won't compile with the current setup and shared libraries yet
21-
set(BUILD_EXAMPLES OFF)
2219
else()
2320
set(Boost_USE_STATIC_LIBS ON)
2421
endif()

libs/network/src/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ set(CPP-NETLIB_HTTP_SERVER_SRCS
9999
)
100100
add_library(cppnetlib-http-server ${CPP-NETLIB_HTTP_SERVER_SRCS})
101101
add_dependencies(cppnetlib-http-server
102-
# ${Boost_LIBRARIES}
103102
cppnetlib-constants
104103
cppnetlib-uri
105104
cppnetlib-message
@@ -108,6 +107,7 @@ add_dependencies(cppnetlib-http-server
108107
cppnetlib-http-message
109108
cppnetlib-http-message-wrappers
110109
cppnetlib-http-server-parsers
110+
cppnetlib-utils-thread_pool
111111
)
112112
target_link_libraries(cppnetlib-http-server
113113
${Boost_LIBRARIES}
@@ -119,6 +119,7 @@ target_link_libraries(cppnetlib-http-server
119119
cppnetlib-http-message
120120
cppnetlib-http-message-wrappers
121121
cppnetlib-http-server-parsers
122+
cppnetlib-utils-thread_pool
122123
)
123124
foreach (src_file ${CPP-NETLIB_HTTP_SERVER_SRCS})
124125
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
@@ -150,7 +151,6 @@ set(CPP-NETLIB_HTTP_CLIENT_SRCS
150151
http/client.cpp)
151152
add_library(cppnetlib-http-client ${CPP-NETLIB_HTTP_CLIENT_SRCS})
152153
add_dependencies(cppnetlib-http-client
153-
# ${Boost_LIBRARIES}
154154
cppnetlib-constants
155155
cppnetlib-uri
156156
cppnetlib-message

0 commit comments

Comments
 (0)