调整构建配置
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(Transmission)
|
||||
|
||||
if(NOT DEFINED TARGET_SYSTEM_NAME)
|
||||
set(TARGET_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||
message("使用默认目标 : ${TARGET_SYSTEM_NAME}")
|
||||
endif ()
|
||||
if (${TARGET_SYSTEM_NAME} STREQUAL "Linux")
|
||||
add_definitions(-DBUILD_LINUX=1)
|
||||
message("以Linux为构建目标")
|
||||
elseif (${TARGET_SYSTEM_NAME} STREQUAL "Windows")
|
||||
add_definitions(-DBUILD_WINDOWS=1)
|
||||
message("以Windows为构建目标")
|
||||
else ()
|
||||
message(FATAL_ERROR "未知的目标操作系统")
|
||||
endif ()
|
||||
|
||||
add_subdirectory(src)
|
||||
if (IS_TEST)
|
||||
add_subdirectory(test)
|
||||
|
||||
@@ -19,19 +19,6 @@ add_library(Transmission
|
||||
CharBuff.cpp
|
||||
Exception/PrepareDataException.h
|
||||
)
|
||||
if(NOT DEFINED TARGET_SYSTEM_NAME)
|
||||
set(TARGET_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
|
||||
message("使用默认目标 : ${TARGET_SYSTEM_NAME}")
|
||||
endif ()
|
||||
if (${TARGET_SYSTEM_NAME} STREQUAL "Linux")
|
||||
add_definitions(-DBUILD_LINUX=1)
|
||||
message("以Linux为构建目标")
|
||||
elseif (${TARGET_SYSTEM_NAME} STREQUAL "Windows")
|
||||
add_definitions(-DBUILD_WINDOWS=1)
|
||||
message("以Windows为构建目标")
|
||||
else ()
|
||||
message(FATAL_ERROR "未知的目标操作系统")
|
||||
endif ()
|
||||
|
||||
target_include_directories(Transmission PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(NOT DEFINED PROTOBUF_LIB_PATH)
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Transmission {
|
||||
virtual void dataArrives(unsigned char *data, size_t size);
|
||||
|
||||
/// 发送数据
|
||||
virtual void sendData(unsigned char *data, size_t size, int type = 0);
|
||||
virtual void sendData(unsigned char *data, size_t size, int type);
|
||||
|
||||
/// 数据包就绪
|
||||
/// @param type 数据包类型
|
||||
|
||||
Reference in New Issue
Block a user