Fix CI tests and compiler warnings

This commit is contained in:
Fangjun Kuang 2022-06-01 18:21:30 +08:00
parent 6e41bb2039
commit d1a473a069
2 changed files with 19 additions and 0 deletions

View File

@ -57,5 +57,17 @@ configure_file(
${CMAKE_SOURCE_DIR}/kaldifeat/python/kaldifeat/torch_version.py @ONLY ${CMAKE_SOURCE_DIR}/kaldifeat/python/kaldifeat/torch_version.py @ONLY
) )
if(WIN32)
# disable various warnings for MSVC
# 4624: destructor was implicitly defined as deleted because a base class destructor is inaccessible or deleted
set(disabled_warnings
/wd4624
)
message(STATUS "Disabled warnings: ${disabled_warnings}")
foreach(w IN LISTS disabled_warnings)
string(APPEND CMAKE_CXX_FLAGS " ${w} ")
endforeach()
endif()
include_directories(${CMAKE_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR})
add_subdirectory(kaldifeat) add_subdirectory(kaldifeat)

View File

@ -31,9 +31,15 @@ function(kaldifeat_add_test source)
gtest_main gtest_main
) )
# NOTE: We set the working directory here so that
# it works also on windows. The reason is that
# the required DLLs are inside ${TORCH_DIR}/lib
# and they can be found by the exe if the current
# working directory is ${TORCH_DIR}\lib
add_test(NAME "Test.${name}" add_test(NAME "Test.${name}"
COMMAND COMMAND
$<TARGET_FILE:${name}> $<TARGET_FILE:${name}>
WORKING_DIRECTORY ${TORCH_DIR}/lib
) )
endfunction() endfunction()
@ -47,4 +53,5 @@ if(kaldifeat_BUILD_TESTS)
foreach(source IN LISTS test_srcs) foreach(source IN LISTS test_srcs)
kaldifeat_add_test(${source}) kaldifeat_add_test(${source})
endforeach() endforeach()
endif() endif()