如何避免SWIG的"Deprecated command line option: -modern. This option is now always on."



由于我正在运行一个更新的系统,我的构建日志(在本例中为GNU Radio(中充斥着

Deprecated command line option: -modern. This option is now always on.

我把这归结为SWIG是罪魁祸首。但是(和往常一样(,SWIG文档和变更日志没有指定何时添加,因此我很难根据使用的SWIG版本禁用-command参数。

由于该选项始终处于哪个SWIG版本?

对巨大的swig/Source/Modules/Python.cxx的强烈指责导致人们意识到这发生在git commit e4fceee12中;git describe e4fceee12产生rel-3.0.12-1146-ge4ceee12,即SWIG版本3.0.12。

我已经能够使用禁用它

set(modern_keyword "-modern")
if("${SWIG_VERSION}" VERSION_GREATER "3.0.12")
set(modern_keyword "")
endif()
set(CMAKE_SWIG_FLAGS … ${modern_keyword} …)

在我的CMake基础设施中。

最新更新