修改构建配置

This commit is contained in:
2024-04-26 21:49:00 +08:00
parent 00b12c8266
commit 6cbd7febf8

View File

@@ -19,11 +19,14 @@ add_library(Transmission
CharBuff.cpp
Exception/PrepareDataException.h
)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
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 (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
elseif (${TARGET_SYSTEM_NAME} STREQUAL "Windows")
add_definitions(-DBUILD_WINDOWS=1)
message("以Windows为构建目标")
else ()