@@ -14,7 +14,7 @@ endif()
14
14
if (Boost_FOUND)
15
15
set ( TESTS
16
16
request_incremental_parser_test
17
- request_linearize_test
17
+ request_linearize_test
18
18
)
19
19
foreach ( test ${TESTS} )
20
20
add_executable (cpp-netlib-http-${test} ${test} .cpp)
@@ -23,9 +23,12 @@ if (Boost_FOUND)
23
23
target_link_libraries (cpp-netlib-http-${test}
24
24
${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
25
25
cppnetlib-uri)
26
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
27
- target_link_libraries (cpp-netlib-http-${test} rt)
28
- endif ()
26
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
27
+ target_link_libraries (cpp-netlib-http-${test} ws2_32)
28
+ endif ()
29
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
30
+ target_link_libraries (cpp-netlib-http-${test} rt)
31
+ endif ()
29
32
set_target_properties (cpp-netlib-http-${test}
30
33
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
31
34
add_test (cpp-netlib-http-${test}
@@ -50,9 +53,12 @@ if (Boost_FOUND)
50
53
if (OPENSSL_FOUND)
51
54
target_link_libraries (cpp-netlib-http-${test} ${OPENSSL_LIBRARIES} )
52
55
endif ()
53
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
54
- target_link_libraries (cpp-netlib-http-${test} rt)
55
- endif ()
56
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
57
+ target_link_libraries (cpp-netlib-http-${test} ws2_32)
58
+ endif ()
59
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
60
+ target_link_libraries (cpp-netlib-http-${test} rt)
61
+ endif ()
56
62
set_target_properties (cpp-netlib-http-${test}
57
63
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
58
64
add_test (cpp-netlib-http-${test}
@@ -68,9 +74,12 @@ if (Boost_FOUND)
68
74
add_executable (cpp-netlib-http-${test} ${test} .cpp)
69
75
add_dependencies (cpp-netlib-http-${test} cppnetlib-server-parsers)
70
76
target_link_libraries (cpp-netlib-http-${test} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} cppnetlib-server-parsers)
71
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
72
- target_link_libraries (cpp-netlib-http-${test} rt)
73
- endif ()
77
+ if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU AND ${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
78
+ target_link_libraries (cpp-netlib-http-${test} ws2_32 wsock32)
79
+ endif ()
80
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
81
+ target_link_libraries (cpp-netlib-http-${test} rt)
82
+ endif ()
74
83
set_target_properties (cpp-netlib-http-${test}
75
84
PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CPP-NETLIB_BINARY_DIR }/tests)
76
85
add_test (cpp-netlib-http-${test}
0 commit comments