为什么在构建静态库时CMake忽略程序集文件? [英] Why is CMake ignoring assembly files when building static library?

查看:121
本文介绍了为什么在构建静态库时CMake忽略程序集文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置

set(CAN_USE_ASSEMBLER TRUE)

这根本没有帮助.我正在尝试使用以下命令创建静态库:

And it's not helping at all. I'm trying to create a static library with a command like:

add_library(${CMAKE_PROJECT_NAME} STATIC ../PropWare ../spi ../spi_as.S ../sd)

其中没有扩展名的文件是C ++或C文件,而.S文件是程序集.但是,当我运行cmake并进行make时,它将编译C/C ++源代码,并且只忽略汇编文件...没有警告,没有错误...只是跳过了它.

where the files without extensions are C++ or C files and the .S file is assembly. But when I run cmake and make, it compiles the C/C++ sources and just ignores the assembly file... no warnings, no errors... just skips right over it.

我会喜欢任何想法.完整的源代码位于 github 上(请注意:此链接指向cmake分支,所有其他则应被忽略).第一行在此文件中,第二行在此文件.

I'd love any ideas. Full source is available on github (do note: this link is to the cmake branch, all others should be ignored). The first line is in this file and the second line is in this file.

谢谢, 大卫

推荐答案

最后找到了它.代替

set(CAN_USE_ASSEMBLER TRUE)

我应该用过

enable_language(ASM)

这篇关于为什么在构建静态库时CMake忽略程序集文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆