如何阻止警告在 JHBuild 中被视为错误

如何阻止警告在 JHBuild 中被视为错误

我尝试mutter使用 JHBuild 构建模块,但失败了:

<snip>
make[4]: Entering directory `/home/wena/src/mutter/src'
  CC     screen.lo
core/screen.c: In function 'reload_monitor_infos':
core/screen.c:445:16: error: variable 'display' set but not used [-Werror=unused-but-set-variable]
core/screen.c: At top level:
core/screen.c:394:1: error: 'find_monitor_with_rect' defined but not used [-Werror=unused-function]
core/screen.c:418:1: error: 'find_main_output_for_crtc' defined but not used [-Werror=unused-function]
cc1: all warnings being treated as errors

make[4]: *** [screen.lo] Error 1
make[4]: Leaving directory `/home/wena/src/mutter/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/wena/src/mutter/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/wena/src/mutter/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/wena/src/mutter'
make: *** [all] Error 2
*** Error during phase build of mutter: ########## Error running make   *** [1/1]

答案1

使用问题中的示例,将以下内容放入“~.jhbuildrc“ 文件 (参考):

module_autogenargs = {"mutter": "--disable-Werror"}

答案2

您应该--enable-compile-warnings=yes在配置构建时使用该开关。这将阻止-Werror在编译期间设置编译器标志。

答案3

好吧,如果--disable-Werror不起作用,您可以添加 -i 选项(for make)来忽略所有错误,因为看起来我正在构建的程序的开发人员-Werror在其代码中的某处物理硬编码了该选项。

相关内容