我有一个库我的项目要看,我看看这个submodule有git --recursive,然后将其包含在我的CMakeLists.txt文件:
add_subdirectory(dependencies/library)
add_executable(myExe ...)
add_dependencies(myExe library)
target_link_libraries(myExe library)
Run Code Online (Sandbox Code Playgroud)
library是一个非常大的库,重新编译它需要花费大量时间。
我几乎从不更改它,因此它应该构建一次,但是每次我向 CMakeLists.txt 文件添加一行并完全刷新 Visual Studio 解决方案时,CMake 都会重新编译它。
如果没有任何更改,如何避免这种可怕的行为并告诉 CMake 不要重新编译库?
| 归档时间: |
|
| 查看次数: |
445 次 |
| 最近记录: |