diff --git a/cmake/CheckTrezor.cmake b/cmake/CheckTrezor.cmake index d95fe7002..b436e2df5 100644 --- a/cmake/CheckTrezor.cmake +++ b/cmake/CheckTrezor.cmake @@ -161,6 +161,15 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR) file(READ "${_proto_out_dir}/${file}" file_content) string(REPLACE "PROTOBUF_DEPRECATED_ENUM" "" updated_content "${file_content}") + string(PREPEND updated_content + "#if defined(__GNUC__)\n" + "#pragma GCC diagnostic push\n" + "#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n" + "#endif\n") + string(APPEND updated_content + "#if defined(__GNUC__)\n" + "#pragma GCC diagnostic pop\n" + "#endif\n") file(WRITE "${_proto_out_dir}/${file}" "${updated_content}") endforeach ()