add:添加支持musl静态链接

This commit is contained in:
taynpg 2025-02-17 18:29:23 +08:00
parent 3b3ea32de1
commit 4e158b3065
6 changed files with 30 additions and 8 deletions

View File

@ -1,5 +1,3 @@
#!/bin/bash
# 默认构建命令
build_command="cmake -Bbuild -DCMAKE_BUILD_TYPE=Release"
build_command_release="cmake --build build --config Release"

View File

@ -24,3 +24,14 @@ if(DEFINED MINGW32_XP_BOOST)
target_link_directories(tsc PRIVATE ${MBOOST_LIB_DIR})
target_link_libraries(tsc PRIVATE ${MBOOST_LIBS})
endif()
if(UNIX)
execute_process(
COMMAND uname -a
OUTPUT_VARIABLE UNAME_OUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(UNAME_OUT MATCHES "alpine" OR UNAME_OUT MATCHES "Alpine")
message(STATUS "tsc on musl static link")
target_link_libraries(tsc PRIVATE -static;-static-libstdc++)
endif()
endif()

View File

@ -19,7 +19,9 @@ elseif(UNAME_OUTPUT MATCHES "riscv64")
else()
set(SYSTEM_ARCH "unknown")
endif()
if(UNAME_OUTPUT MATCHES "alpine" OR UNAME_OUTPUT MATCHES "Alpine")
set(SYSTEM_ARCH "musl_${SYSTEM_ARCH}")
endif()
elseif (WIN32)
# ver
execute_process(COMMAND cmd /c ver

@ -1 +1 @@
Subproject commit a7c6434a7c333a19727aeab8212d20604426b701
Subproject commit 86e71fbb462efce80e601db0807bca0887829836

2
ofen

@ -1 +1 @@
Subproject commit 36e05d261821048a4c2fec1042434dd2dfc9b6de
Subproject commit c4572bbfef4b39d40f8f530aecdf0998d1821232

View File

@ -23,3 +23,14 @@ endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(tss PRIVATE ws2_32 wsock32)
endif()
if(UNIX)
execute_process(
COMMAND uname -a
OUTPUT_VARIABLE UNAME_OUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(UNAME_OUT MATCHES "alpine" OR UNAME_OUT MATCHES "Alpine")
message(STATUS "on musl static link")
target_link_libraries(tss PRIVATE -static;-static-libstdc++)
endif()
endif()