Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
突出显示makefile中的警告消息_Makefile_Cmake - Fatal编程技术网

突出显示makefile中的警告消息

突出显示makefile中的警告消息,makefile,cmake,Makefile,Cmake,我在Makefile中有一些代码如下所示 ifeq ($(COMPARISON_NODE_VERSION),-1) $(warning Please update your nodejs version to $(ENV_NODE_VERSION), or it may cause unexpected error later.) endif 是否有机会更改msg的颜色,如黄色?Make无法做到这一点,但如果您愿意,您可以通过在消息文本中嵌入颜色代码序列来完成。在makefile中查看可能有点

我在Makefile中有一些代码如下所示

ifeq ($(COMPARISON_NODE_VERSION),-1)
$(warning Please update your nodejs version to $(ENV_NODE_VERSION), or it may cause unexpected error later.)
endif

是否有机会更改msg的颜色,如黄色?

Make无法做到这一点,但如果您愿意,您可以通过在消息文本中嵌入颜色代码序列来完成。在makefile中查看可能有点恶心(您必须使用实际代码:make不翻译字符代码)。

将颜色代码序列嵌入到消息文本中,您有没有示例?问题是,此消息应在所有任务之前显示。在读入makefile时,将对不属于配方的函数进行求值,因此在解析makefile时将打印此警告。至于颜色代码,这取决于您的终端。然而,大多数终端支持代码。您还可以使用
tput
为您生成一些代码:请参阅