Skip to content

Commit 63083f0

Browse files
authored
Avoid re-downloading files when used as a subproject. (#60)
1 parent 95774ab commit 63083f0

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
1313

1414
project(kaldifst CXX)
1515

16-
set(KALDIFST_VERSION "1.7.9")
16+
set(KALDIFST_VERSION "1.7.10")
17+
18+
# Disable warning about
19+
#
20+
# "The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
21+
# not set.
22+
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
23+
cmake_policy(SET CMP0135 NEW)
24+
endif()
1725

1826
if(NOT CMAKE_BUILD_TYPE)
1927
message(STATUS "No CMAKE_BUILD_TYPE given, default to Release")

cmake/googletest.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function(download_googltest)
99
# please pre-download googletest
1010
set(possible_file_locations
1111
$ENV{HOME}/Downloads/googletest-1.13.0.tar.gz
12-
${PROJECT_SOURCE_DIR}/googletest-1.13.0.tar.gz
13-
${PROJECT_BINARY_DIR}/googletest-1.13.0.tar.gz
12+
${CMAKE_SOURCE_DIR}/googletest-1.13.0.tar.gz
13+
${CMAKE_BINARY_DIR}/googletest-1.13.0.tar.gz
1414
/tmp/googletest-1.13.0.tar.gz
1515
/star-fj/fangjun/download/github/googletest-1.13.0.tar.gz
1616
)

cmake/openfst.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ function(download_openfst)
1111
# please pre-download it
1212
set(possible_file_locations
1313
$ENV{HOME}/Downloads/openfst-win-1.6.5.1.tar.gz
14-
${PROJECT_SOURCE_DIR}/openfst-win-1.6.5.1.tar.gz
15-
${PROJECT_BINARY_DIR}/openfst-win-1.6.5.1.tar.gz
14+
${CMAKE_SOURCE_DIR}/openfst-win-1.6.5.1.tar.gz
15+
${CMAKE_BINARY_DIR}/openfst-win-1.6.5.1.tar.gz
1616
/tmp/openfst-win-1.6.5.1.tar.gz
1717
/star-fj/fangjun/download/github/openfst-win-1.6.5.1.tar.gz
1818
)

cmake/pybind11.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ function(download_pybind11)
99
# please pre-download pybind11
1010
set(possible_file_locations
1111
$ENV{HOME}/Downloads/pybind11-2.10.2.tar.gz
12-
${PROJECT_SOURCE_DIR}/pybind11-2.10.2.tar.gz
13-
${PROJECT_BINARY_DIR}/pybind11-2.10.2.tar.gz
12+
${CMAKE_SOURCE_DIR}/pybind11-2.10.2.tar.gz
13+
${CMAKE_BINARY_DIR}/pybind11-2.10.2.tar.gz
1414
/tmp/pybind11-2.10.2.tar.gz
1515
/star-fj/fangjun/download/github/pybind11-2.10.2.tar.gz
1616
)

kaldifst/csrc/kaldi-math.cc

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ int32_t RandInt(int32_t min_val, int32_t max_val,
6464
} else {
6565
KALDIFST_ERR << "rand_int failed because we do not support such large "
6666
"random numbers. (Extend this function).";
67+
68+
return min_val; // unreachable code
6769
}
6870
}
6971
#else

0 commit comments

Comments
 (0)