Supports cmake compilation compatible with v3.13. (#340)

Co-authored-by: chenyu <cheny65@chinatelecom.cn>
This commit is contained in:
poor1017
2023-09-25 11:48:55 +08:00
committed by GitHub
parent fef61080de
commit c2518a5826
2 changed files with 2 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ endif()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
if(NOT BUILD_SHARED_LIBS AND LINUX AND NOT APPLE)
if(NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL Linux)
if(SHERPA_ONNX_LINK_LIBSTDCPP_STATICALLY)
message(STATUS "Link libstdc++ statically")
set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc ")

View File

@@ -122,7 +122,7 @@ if(SHERPA_ONNX_ENABLE_CHECK)
endif()
endif()
if(NOT BUILD_SHARED_LIBS AND LINUX AND NOT APPLE)
if(NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(sherpa-onnx-core -pthread -ldl)
endif()