diff --git a/src/coro_http/examples/CMakeLists.txt b/src/coro_http/examples/CMakeLists.txt index dc662924a..7d87880f2 100644 --- a/src/coro_http/examples/CMakeLists.txt +++ b/src/coro_http/examples/CMakeLists.txt @@ -29,3 +29,8 @@ endif() add_executable(coro_http_example example.cpp) add_executable(coro_http_channel channel.cpp) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_http_example wsock32 ws2_32) + target_link_libraries(coro_http_channel wsock32 ws2_32) +endif() \ No newline at end of file diff --git a/src/coro_io/examples/CMakeLists.txt b/src/coro_io/examples/CMakeLists.txt index a766f24f7..e5bb81a64 100644 --- a/src/coro_io/examples/CMakeLists.txt +++ b/src/coro_io/examples/CMakeLists.txt @@ -29,3 +29,7 @@ endif() add_executable(coro_io_example main.cpp) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_io_example wsock32 ws2_32) +endif() + diff --git a/src/coro_io/tests/CMakeLists.txt b/src/coro_io/tests/CMakeLists.txt index 714e8e69b..3fef160cc 100644 --- a/src/coro_io/tests/CMakeLists.txt +++ b/src/coro_io/tests/CMakeLists.txt @@ -5,6 +5,9 @@ add_executable(coro_io_test test_client_pool.cpp main.cpp ) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_io_test wsock32 ws2_32) +endif() add_test(NAME coro_io_test COMMAND coro_io_test) diff --git a/src/coro_rpc/benchmark/CMakeLists.txt b/src/coro_rpc/benchmark/CMakeLists.txt index 467ccbc76..af88e84eb 100644 --- a/src/coro_rpc/benchmark/CMakeLists.txt +++ b/src/coro_rpc/benchmark/CMakeLists.txt @@ -1,11 +1,18 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/benchmark) add_executable(coro_rpc_benchmark_server server.cpp) - add_executable(coro_rpc_benchmark_client client.cpp) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_rpc_benchmark_server wsock32 ws2_32) + target_link_libraries(coro_rpc_benchmark_client wsock32 ws2_32) +endif() + if (GENERATE_BENCHMARK_DATA) add_executable(coro_rpc_benchmark_data_gen data_gen.cpp) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_rpc_benchmark_data_gen wsock32 ws2_32) + endif() target_compile_definitions(coro_rpc_benchmark_data_gen PRIVATE GENERATE_BENCHMARK_DATA) add_custom_command( TARGET coro_rpc_benchmark_data_gen POST_BUILD diff --git a/src/coro_rpc/examples/base_examples/CMakeLists.txt b/src/coro_rpc/examples/base_examples/CMakeLists.txt index 567c24c60..1265fd7ca 100644 --- a/src/coro_rpc/examples/base_examples/CMakeLists.txt +++ b/src/coro_rpc/examples/base_examples/CMakeLists.txt @@ -43,3 +43,12 @@ add_executable(coro_rpc_example_client client.cpp) add_executable(coro_rpc_example_concurrent_clients concurrent_clients.cpp) add_executable(coro_rpc_example_server server.cpp rpc_service.cpp) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_rpc_example_channel wsock32 ws2_32) + target_link_libraries(coro_rpc_example_client_pool wsock32 ws2_32) + target_link_libraries(coro_rpc_example_client_pools wsock32 ws2_32) + target_link_libraries(coro_rpc_example_client wsock32 ws2_32) + target_link_libraries(coro_rpc_example_concurrent_clients wsock32 ws2_32) + target_link_libraries(coro_rpc_example_server wsock32 ws2_32) +endif() + diff --git a/src/coro_rpc/examples/file_transfer/CMakeLists.txt b/src/coro_rpc/examples/file_transfer/CMakeLists.txt index e1a05b559..3b410de5e 100644 --- a/src/coro_rpc/examples/file_transfer/CMakeLists.txt +++ b/src/coro_rpc/examples/file_transfer/CMakeLists.txt @@ -42,3 +42,8 @@ add_executable(coro_rpc_file_server ) add_executable(coro_rpc_file_client file_client.cpp) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_rpc_file_server wsock32 ws2_32) + target_link_libraries(coro_rpc_file_client wsock32 ws2_32) +endif() + diff --git a/src/coro_rpc/examples/user_defined_rpc_protocol/rest_rpc/CMakeLists.txt b/src/coro_rpc/examples/user_defined_rpc_protocol/rest_rpc/CMakeLists.txt index 304748603..90dd68c1c 100644 --- a/src/coro_rpc/examples/user_defined_rpc_protocol/rest_rpc/CMakeLists.txt +++ b/src/coro_rpc/examples/user_defined_rpc_protocol/rest_rpc/CMakeLists.txt @@ -51,6 +51,10 @@ endif() target_compile_definitions(coro_rpc_example_use_rest_rpc_protocol PRIVATE HAVE_MSGPACK) target_compile_definitions(coro_rpc_example_use_rest_rpc_protocol PRIVATE MSGPACK_NO_BOOST) +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_rpc_example_use_rest_rpc_protocol wsock32 ws2_32) +endif() + else() message(WARNING "Could Not Found Msgpack, disable coro_rpc_example_use_rest_rpc_protocol") endif() diff --git a/src/coro_rpc/tests/CMakeLists.txt b/src/coro_rpc/tests/CMakeLists.txt index 025b23672..8a3924b0c 100644 --- a/src/coro_rpc/tests/CMakeLists.txt +++ b/src/coro_rpc/tests/CMakeLists.txt @@ -36,4 +36,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output/tests/coro_rpc) add_executable(coro_rpc_regist_test_1 rpc_api.cpp test_register_duplication_1.cpp) add_executable(coro_rpc_regist_test_2 rpc_api.cpp test_register_duplication_2.cpp) -add_executable(coro_rpc_regist_test_3 rpc_api.cpp test_register_duplication_3.cpp) \ No newline at end of file +add_executable(coro_rpc_regist_test_3 rpc_api.cpp test_register_duplication_3.cpp) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") # mingw-w64 + target_link_libraries(coro_rpc_test wsock32 ws2_32) + target_link_libraries(coro_rpc_regist_test_1 wsock32 ws2_32) + target_link_libraries(coro_rpc_regist_test_2 wsock32 ws2_32) + target_link_libraries(coro_rpc_regist_test_3 wsock32 ws2_32) +endif() \ No newline at end of file