compile:修正win下mingw编译。
This commit is contained in:
parent
67aaa9c299
commit
7519765018
@ -8,6 +8,12 @@ if (MSVC)
|
|||||||
add_compile_options(/source-charset:utf-8)
|
add_compile_options(/source-charset:utf-8)
|
||||||
endif()
|
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")
|
set(CMAKE_DEBUG_POSTFIX "d")
|
||||||
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
|
message(STATUS "System: ${CMAKE_SYSTEM_NAME}")
|
||||||
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
|
message(STATUS "Compiler CXX ID: ${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
@ -12,4 +12,7 @@ add_executable(transmc main.cpp client.h client.cpp file_oper.h file_oper.cpp)
|
|||||||
target_link_libraries(transmc PRIVATE trans_net trans_util)
|
target_link_libraries(transmc PRIVATE trans_net trans_util)
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_link_libraries(transmc PRIVATE pthread)
|
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()
|
endif()
|
2
ofen
2
ofen
@ -1 +1 @@
|
|||||||
Subproject commit cf6168a89a784521df0c9d63a049bc025daa1b85
|
Subproject commit 1e83e393eb2ee59d05690a7c39bf807c994560b2
|
@ -10,5 +10,8 @@ endif()
|
|||||||
add_executable(transms main.cpp server.h server.cpp)
|
add_executable(transms main.cpp server.h server.cpp)
|
||||||
target_link_libraries(transms PRIVATE trans_net trans_util)
|
target_link_libraries(transms PRIVATE trans_net trans_util)
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
target_link_libraries(transms PRIVATE pthread)
|
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()
|
endif()
|
Loading…
x
Reference in New Issue
Block a user