You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### What problem were solved in this pull request?
Issue Number: close#91close#1
Problem:
编译时编译器抛出的一些告警信息可以帮我们避免很多问题,但是现在并没有利用这个特性
### What is changed and how it works?
CMake中增加-Werror编译选项
### Other information
miniob的小伙伴们你们好,我使用
vim
搭配coc.nvim
以及clangd
实现c/c++的自动补全,因此对compile_commands.json
有需求。当前的CMakeLists.txt已经涉及
compile_commands.json
的生成,但是这个FLAG的位置应该摆错了。miniob/CMakeLists.txt
Line 40 in c611d5f
虽然
CMAKE_COMMON_FLAGS
这个变量感觉上是设置了cmake
的FLAGS,但是最后其实是赋值给了CMAKE_CXX_FLAGS
,而-DCMAKE_EXPORT_COMPILE_COMMANDS=1
这个参数是用在cmake
上的,而不是gcc
。解决方法是:
1、在CMakeLists.txt开头位置附近加上
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2、或在运行cmake时加上参数,即
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
这样就能生成
compile_commands.json
:The text was updated successfully, but these errors were encountered: