- 主题:cmake 生成makefile 怎么输出完整的编译命令
一个开源工程用cmake写的编译的时候,不确定交叉编译的设置是否正确,想输出完整的编译文件过程,至少可以在出错的时候输出最后一条编译命令的完整命令,怎么设置?
比如下面的输出,只输出了错误原因,没有输出编译命令
ling@ling:~/src/cmakeqnx/build$ make
[ 25%] Building C object src/CMakeFiles/Test.dir/test.c.o
/home/ling/src/cmakeqnx/src/test.c: In function 'add':
/home/ling/src/cmakeqnx/src/test.c:3:1: error: 'sdfsdf' undeclared (first use in this function)
sdfsdf}
^~~~~~
/home/ling/src/cmakeqnx/src/test.c:3:1: note: each undeclared identifier is reported only once for each function it appears in
/home/ling/src/cmakeqnx/src/test.c:3:7: error: expected ';' before '}' token
sdfsdf}
^
;
src/CMakeFiles/Test.dir/build.make:62: recipe for target 'src/CMakeFiles/Test.dir/test.c.o' failed
make[2]: *** [src/CMakeFiles/Test.dir/test.c.o] Error 1
CMakeFiles/Makefile2:122: recipe for target 'src/CMakeFiles/Test.dir/all' failed
make[1]: *** [src/CMakeFiles/Test.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
ling@ling:~/src/cmakeqnx/build$
--
FROM 66.152.181.*
试试 VERBOSE=1 make
【 在 freyoneby (freyoneby) 的大作中提到: 】
: 一个开源工程用cmake写的编译的时候,不确定交叉编译的设置是否正确,想输出完整的编译文件过程,至少可以在出错的时候输出最后一条编译命令的完整命令,怎么设置?
: 比如下面的输出,只输出了错误原因,没有输出编译命令
: ling@ling:~/src/cmakeqnx/build$ make
: ...................
--
FROM 219.238.250.*
试过没用
【 在 mountainlion 的大作中提到: 】
: 试试 VERBOSE=1 make
:
:
: ....................
- 来自「最水木 for iPhone 7 Plus」
--
FROM 117.59.117.*
V=99试过吗?
【 在 freyoneby 的大作中提到: 】
: 试过没用
: 【 在 mountainlion 的大作中提到: 】
: : 试试 VERBOSE=1 make
: ....................
- 来自「最水木 for iPhone14,2」
--
FROM 1.202.162.*
一样的
【 在 Minjun 的大作中提到: 】
: V=99试过吗?
: 【 在 freyoneby 的大作中提到: 】
: : 试过没用
: ....................
- 来自「最水木 for iPhone 7 Plus」
--
FROM 117.59.117.*
我这里make VERBOSE=1是可以生效的,你看看Makefile就知道了:
# Command-line flag to silence nested $(MAKE).
$(VERBOSE)MAKESILENT = -s
#Suppress display of executed commands.
$(VERBOSE).SILENT:
设置成其它值也无所谓,反正只要非空就行
【 在 freyoneby (freyoneby) 的大作中提到: 】
: 一个开源工程用cmake写的编译的时候,不确定交叉编译的设置是否正确,想输出完整的编译文件过程,至少可以在出错的时候输出最后一条编译命令的完整命令,怎么设置?
: 比如下面的输出,只输出了错误原因,没有输出编译命令
: ling@ling:~/src/cmakeqnx/build$ make
: ...................
--
FROM 222.128.5.*
【 在 freyoneby 的大作中提到: 】
: 一个开源工程用cmake写的编译的时候,不确定交叉编译的设置是否正确,想输出完整的编译文件过程,至少可以在出错的时候输出最后一条编译命令的完整命令,怎么设置?
: 比如下面的输出,只输出了错误原因,没有输出编译命令
: ling@ling:~/src/cmakeqnx/build$ make
: ...................
配置一下ninja,可以在编译目录下生成一个build.ninja,里面有详细参数
--
FROM 119.28.131.*
VERBOSE=1 可以,一开始不知道为什么不行
【 在 mountainlion 的大作中提到: 】
: 试试 VERBOSE=1 make
:
--
FROM 117.59.117.*
大概率是你拼错了,可以敲history确认一下
【 在 freyoneby (freyoneby) 的大作中提到: 】
: VERBOSE=1 可以,一开始不知道为什么不行
--
FROM 222.128.5.*