Disable build shared libs on Windows.

This commit is contained in:
Fangjun Kuang 2022-04-03 14:36:24 +08:00
parent 959da88b6e
commit 00e550c11b
2 changed files with 7 additions and 1 deletions

View File

@ -18,6 +18,12 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_RPATH "$ORIGIN") set(CMAKE_BUILD_RPATH "$ORIGIN")
set(BUILD_SHARED_LIBS ON)
if(WIN32)
message(STATUS "Set BUILD_SHARED_LIBS to OFF for Windows")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
endif()
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No CMAKE_BUILD_TYPE given, default to Release") message(STATUS "No CMAKE_BUILD_TYPE given, default to Release")
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)

View File

@ -12,7 +12,7 @@ set(kaldifeat_srcs
online-feature.cc online-feature.cc
) )
add_library(kaldifeat_core SHARED ${kaldifeat_srcs}) add_library(kaldifeat_core ${kaldifeat_srcs})
target_link_libraries(kaldifeat_core PUBLIC ${TORCH_LIBRARIES}) target_link_libraries(kaldifeat_core PUBLIC ${TORCH_LIBRARIES})
target_compile_definitions(kaldifeat_core PUBLIC KALDIFEAT_TORCH_VERSION_MAJOR=${KALDIFEAT_TORCH_VERSION_MAJOR}) target_compile_definitions(kaldifeat_core PUBLIC KALDIFEAT_TORCH_VERSION_MAJOR=${KALDIFEAT_TORCH_VERSION_MAJOR})