【发布时间】:2018-06-27 22:42:55
【问题描述】:
当我的 cpp 文件名中有散列/磅/锐利 (#) 时,我会收到类似于
Makefile:22669: warning: overriding recipe for target '.PHONY'
Makefile:22660: warning: ignoring old recipe for target '.PHONY'
Makefile:22678: warning: overriding recipe for target '.PHONY'
Makefile:22669: warning: ignoring old recipe for target '.PHONY'
Makefile:32887: *** missing separator. Stop.
即使生成的 Makefile 似乎只有 178 行长。除了不在我的文件名中使用# 字符之外,还有什么方法可以防止这种情况发生吗?
编辑:分号(;)似乎也会导致这个问题
【问题讨论】:
-
# 表示 CMake 中的注释。
-
@drescherjm 文件名用引号引起来,CMake 没有给我任何错误,它们只是来自 Makefile
-
您是否尝试在 CMake 中转义它们?
-
@drescherjm 是的
-
值得一试。我没有想法。