• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

amezin/vscode-linux-kernel: Visual Studio Code project/compile_commands.json gen ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

amezin/vscode-linux-kernel

开源软件地址(OpenSource Url):

https://github.com/amezin/vscode-linux-kernel

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

Visual Studio Code project for Linux kernel sources

Ensure the kernel is built (at least, all *.cmd files should be generated):

$ make defconfig
$ make

Clone this repository as ".vscode":

$ git clone [email protected]:amezin/vscode-linux-kernel.git .vscode

Generate compile_commands.json:

$ python .vscode/generate_compdb.py

If you are not compiling kernel for x64, change intelliSenseMode in c_cpp_properties.json. Possible values as of vscode-cpptools 1.0.1:

  • gcc-x86
  • gcc-x64
  • gcc-arm
  • gcc-arm64

Open the project:

$ code .

Out-of-tree builds

#4

Kernel can be built with separate output directory:

$ make O=../linux-build defconfig
$ make O=../linux-build

In this case, you should pass the directory to generate_compdb.py:

$ python .vscode/generate_compdb.py -O ../linux-build

compile_commands.json will still be generated in the current directory (root of the linux repository). Unfortunately, tasks.json will not work out of the box in this configuration (TODO).

Out-of-tree module development

If you build your module with this command:

$ make -C $KDIR M=$PWD modules

You could generate compile_commands.json with:

$ python .vscode/generate_compdb.py -O $KDIR $PWD

Example: https://github.com/amezin/nzxt-rgb-fan-controller-dkms




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
open-iscsi/open-iscsi: iSCSI tools for Linux发布时间:2022-08-15
下一篇:
dthree/cash: Cross-platform Linux commands in ES6发布时间:2022-08-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap