Skip to content

Commit cb0828a

Browse files
suykerbuykJohn Suykerbuyk
andauthored
Fix CMake warnings: optional feature message level + policy version minimum (k2-fsa#3217)
* Downgrade optional feature messages from WARNING to STATUS TTS and speaker diarization are optional features controlled by SHERPA_ONNX_ENABLE_TTS and SHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION. Disabling an optional feature is a normal configuration choice, not a warning condition. Using message(WARNING) causes spurious CMake warnings for any project that intentionally sets these to OFF via FetchContent. Change both to message(STATUS) to match the enabled-path messaging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Raise CMAKE_POLICY_VERSION_MINIMUM from 3.5 to 3.10 CMake 4.x emits deprecation warnings for cmake_minimum_required() versions below 3.10 ("Compatibility with CMake < 3.10 will be removed"). Several transitive deps (kaldi-native-fbank 3.5, kissfft 3.6, openfst 3.1) trigger this warning. Raising the floor to 3.10 suppresses these deprecation notices while preserving old policy behaviors for all deps. No functional change — 3.10 is still well below sherpa-onnx's own minimum of 3.15. Co-authored-by: John Suykerbuyk <bd770i@suykerbuyk.org>
1 parent 8bb5266 commit cb0828a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if (CMAKE_VERSION VERSION_GREATER_EQUAL "4.0.0")
2-
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
2+
set(CMAKE_POLICY_VERSION_MINIMUM 3.10)
33
endif()
44

55
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
@@ -261,15 +261,15 @@ if(SHERPA_ONNX_ENABLE_TTS)
261261
message(STATUS "TTS is enabled")
262262
add_definitions(-DSHERPA_ONNX_ENABLE_TTS=1)
263263
else()
264-
message(WARNING "TTS is disabled")
264+
message(STATUS "TTS is disabled")
265265
add_definitions(-DSHERPA_ONNX_ENABLE_TTS=0)
266266
endif()
267267

268268
if(SHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION)
269269
message(STATUS "speaker diarization is enabled")
270270
add_definitions(-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=1)
271271
else()
272-
message(WARNING "speaker diarization is disabled")
272+
message(STATUS "speaker diarization is disabled")
273273
add_definitions(-DSHERPA_ONNX_ENABLE_SPEAKER_DIARIZATION=0)
274274
endif()
275275

0 commit comments

Comments
 (0)