diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-10-16 08:56:46 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-10-16 08:56:46 +0200 |
commit | a80caec19bf0f82de3cbb85f378c925663ffa648 (patch) | |
tree | a951695a31ccd061712e750c6b640985d7e03356 | |
parent | d6b6fff7f723d9f7b3ad8a9bf5b7e8dbd5f22b8f (diff) | |
download | libssh-a80caec19bf0f82de3cbb85f378c925663ffa648.tar.gz libssh-a80caec19bf0f82de3cbb85f378c925663ffa648.tar.xz libssh-a80caec19bf0f82de3cbb85f378c925663ffa648.zip |
cmake: Disable deprecation warnings for old known_hosts API
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | CompilerChecks.cmake | 6 | ||||
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/client/CMakeLists.txt | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake index 3b36cc6c..8112fce7 100644 --- a/CompilerChecks.cmake +++ b/CompilerChecks.cmake @@ -93,6 +93,8 @@ if (UNIX) add_c_compiler_flag("-Wno-error=tautological-compare" SUPPORTED_COMPILER_FLAGS) endif() + add_c_compiler_flag("-Wno-deprecated-declarations" DEPRECATION_COMPILER_FLAGS) + # Unset CMAKE_REQUIRED_FLAGS unset(CMAKE_REQUIRED_FLAGS) endif() @@ -112,3 +114,7 @@ endif() set(DEFAULT_C_COMPILE_FLAGS ${SUPPORTED_COMPILER_FLAGS} CACHE INTERNAL "Default C Compiler Flags" FORCE) set(DEFAULT_LINK_FLAGS ${SUPPORTED_LINKER_FLAGS} CACHE INTERNAL "Default C Linker Flags" FORCE) + +if (DEPRECATION_COMPILER_FLAGS) + set(DEFAULT_C_NO_DEPRECATION_FLAGS ${DEPRECATION_COMPILER_FLAGS} CACHE INTERNAL "Default no deprecation flags" FORCE) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 849919c3..21e94488 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -164,6 +164,12 @@ set(libssh_SRCS chachapoly.c ) +if (DEFAULT_C_NO_DEPRECATION_FLAGS) + set_source_files_properties(known_hosts.c + PROPERTIES + COMPILE_FLAGS ${DEFAULT_C_NO_DEPRECATION_FLAGS}) +endif() + if (CMAKE_USE_PTHREADS_INIT) set(libssh_SRCS ${libssh_SRCS} diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt index b55dfb28..ad82a3e1 100644 --- a/tests/client/CMakeLists.txt +++ b/tests/client/CMakeLists.txt @@ -14,6 +14,11 @@ set(LIBSSH_CLIENT_TESTS torture_session torture_request_env) +if (DEFAULT_C_NO_DEPRECATION_FLAGS) + set_source_files_properties(torture_knownhosts.c + PROPERTIES + COMPILE_FLAGS ${DEFAULT_C_NO_DEPRECATION_FLAGS}) +endif() if (WITH_SFTP) if (WITH_BENCHMARKS) set(SFTP_BENCHMARK_TESTS |