compile:修正win下mingw编译。

This commit is contained in:
taynpg 2024-12-24 12:47:12 +08:00
parent 67aaa9c299
commit 7519765018
4 changed files with 14 additions and 2 deletions

View File

@ -8,6 +8,12 @@ if (MSVC)
add_compile_options(/source-charset:utf-8)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
MESSAGE(STATUS "Add MinGW Param.")
add_compile_options(-finput-charset=utf-8)
add_compile_options(-fexec-charset=gbk)
endif()
set(CMAKE_DEBUG_POSTFIX "d")
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")

View File

@ -13,3 +13,6 @@ target_link_libraries(transmc PRIVATE trans_net trans_util)
if (UNIX)
target_link_libraries(transmc PRIVATE pthread)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(transmc PRIVATE ws2_32 wsock32)
endif()

2
ofen

@ -1 +1 @@
Subproject commit cf6168a89a784521df0c9d63a049bc025daa1b85
Subproject commit 1e83e393eb2ee59d05690a7c39bf807c994560b2

View File

@ -12,3 +12,6 @@ target_link_libraries(transms PRIVATE trans_net trans_util)
if (UNIX)
target_link_libraries(transms PRIVATE pthread)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(transms PRIVATE ws2_32 wsock32)
endif()