将正确的 doxygen 文档作为构建要求

Make correct doxygen documentation a build requirement

我正在使用 Doxygen 来记录一个越来越大的 C++ 项目,我一直想知道如何使 Doxygen 成为该项目的构建要求。换句话说,如果有任何 class/method/etc,我希望我的构建过程失败并停止。 Doxygen 尚未成功记录。我使用 make 进行构建。

例如,我希望它失败(即不构建):

/**
 * @bbrief Oops, tag does not exist, warning is issued and hence build fails.
 */
void f()
{
    // Do something...
}


/**
 * @brief Main function for program X
 *
 * @return End of execution status.
 *
 * ...
 *
 */
int main()
{
    f();

    return 0;
}

但这要构建:

/**
 * @brief Okay, this is fine.
 *
 */
void f()
{
    // Do something...
}


/**
 * @brief Main function for program X
 *
 * @return End of execution status.
 *
 * ...
 *
 */
int main()
{
    f();

    return 0;
}

我曾尝试在 Internet 上搜索此类功能,但到目前为止一无所获。

在大多数情况下,文档已生成,但由于警告,文档不完整。我看到了几种可能性:

编辑

正如@inkychris 所指出的,从 doxygen 版本 1.9.0 开始,WARN_AS_ERROR 具有 FAIL_ON_WARNINGS 的可能性。来自文档:

WARN_AS_ERROR

If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but at the end of the doxygen process doxygen will return with a non-zero status.

Possible values are: NO, YES and FAIL_ON_WARNINGS.