From af29e25b0394265d36264abacdf36ba99b3789d2 Mon Sep 17 00:00:00 2001 From: MWX <146726100+mwx2006@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:38:27 +0800 Subject: [PATCH] Fix name issue when cross-compiling (#1906) --- CMakeLists.txt | 4 ++-- drogon_ctl/CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- lib/src/Utilities.cc | 2 +- trantor | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6906f44..e1ae23e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,7 @@ if (BUILD_SHARED_LIBS) SOVERSION ${DROGON_MAJOR_VERSION}) target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads) if (WIN32) - target_link_libraries(${PROJECT_NAME} PUBLIC Rpcrt4 ws2_32 crypt32 Advapi32) + target_link_libraries(${PROJECT_NAME} PUBLIC rpcrt4 crypt32 advapi32 ws2_32) if (CMAKE_CXX_COMPILER_ID MATCHES MSVC) # Ignore MSVC C4251 and C4275 warning of exporting std objects with no dll export # We export class to facilitate maintenance, thus if you compile @@ -141,7 +141,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") elseif (NOT WIN32 AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") target_link_libraries(${PROJECT_NAME} PRIVATE dl) elseif (WIN32) - target_link_libraries(${PROJECT_NAME} PRIVATE shlwapi) + target_link_libraries(${PROJECT_NAME} PRIVATE shlwapi ws2_32 iphlpapi) endif () list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/) diff --git a/drogon_ctl/CMakeLists.txt b/drogon_ctl/CMakeLists.txt index 249c453d..04b790d3 100755 --- a/drogon_ctl/CMakeLists.txt +++ b/drogon_ctl/CMakeLists.txt @@ -57,7 +57,7 @@ target_link_libraries(drogon_ctl PRIVATE ${PROJECT_NAME}) target_include_directories(drogon_ctl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) add_dependencies(drogon_ctl _drogon_ctl) if(WIN32) - target_link_libraries(drogon_ctl PRIVATE ws2_32 Rpcrt4 iphlpapi) + target_link_libraries(drogon_ctl PRIVATE ws2_32 rpcrt4 iphlpapi) endif(WIN32) if(APPLE) target_link_libraries(drogon_ctl PRIVATE resolv) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index b59097fe..58053c9f 100755 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -48,7 +48,7 @@ set(example_targets # Add warnings for our example targets--some warnings (such as -Wunused-parameter) only appear # when the templated functions are instantiated at their point of use. -if (CMAKE_CXX_COMPILER_ID MATCHES GNU) +if(NOT ${CMAKE_PLATFORM_NAME} STREQUAL "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES GNU) foreach(target ${example_targets}) target_compile_options(${target} PRIVATE -Wall -Wextra -Werror) endforeach() diff --git a/lib/src/Utilities.cc b/lib/src/Utilities.cc index 39afedee..25ff5ac8 100644 --- a/lib/src/Utilities.cc +++ b/lib/src/Utilities.cc @@ -21,7 +21,7 @@ #include #endif #ifdef _WIN32 -#include +#include #include #include #include diff --git a/trantor b/trantor index 2c25a746..7fe01f63 160000 --- a/trantor +++ b/trantor @@ -1 +1 @@ -Subproject commit 2c25a746f31cb211641c9c5bccc132251529d2f5 +Subproject commit 7fe01f638dd9e387f4005806803f0788046cd3bc