VS2022在将新的CPP单元添加到CMAKE项目并配置缓存之后,如何避免在构建所有CPP时推荐所有CPP单元
添加了新的CPP文件并为了使其加入项目后,我必须单击项目 - >配置缓存。然后,我单击“构建” - >构建全部,整个项目,所有CPP单元都将重新编译。我不能容忍。 VS2019的预期行为只有添加CPP单元才能编译。 在我更新到VS2022之后,一切都变得糟糕透顶,整个CPP文件都会从一个一个逐一重新编译。
在我的cmakelists.txt中使用关注语句
file(GLOB_RECURSE LIB_SRC "*.cpp")
add_library(lib ${LIB_SRC})
After adding a new cpp file and in order to get it to join in project, I must click project -> configure cache. Then I click build -> build all, the whole project, all cpp units get recompiled. I can't tolerate.
vs2019 has expected behavior that only adding cpp unit gets compiled.
After I update to vs2022, everything becomes terrible, whole cpp files get recompiled from one by one.
using follow statement in my CMakeLists.txt
file(GLOB_RECURSE LIB_SRC "*.cpp")
add_library(lib ${LIB_SRC})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论