From d1a473a0694b6735505d245c55a221298397216c Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 1 Jun 2022 18:21:30 +0800 Subject: [PATCH] Fix CI tests and compiler warnings --- CMakeLists.txt | 12 ++++++++++++ kaldifeat/csrc/CMakeLists.txt | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f594460..380338b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,5 +57,17 @@ configure_file( ${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}) add_subdirectory(kaldifeat) diff --git a/kaldifeat/csrc/CMakeLists.txt b/kaldifeat/csrc/CMakeLists.txt index 39f2c1c..9900b96 100644 --- a/kaldifeat/csrc/CMakeLists.txt +++ b/kaldifeat/csrc/CMakeLists.txt @@ -31,9 +31,15 @@ function(kaldifeat_add_test source) 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}" COMMAND $ + WORKING_DIRECTORY ${TORCH_DIR}/lib ) endfunction() @@ -47,4 +53,5 @@ if(kaldifeat_BUILD_TESTS) foreach(source IN LISTS test_srcs) kaldifeat_add_test(${source}) endforeach() + endif()