clion 阅读 linux kernel wsl
ddatsh
早期clion只支持Cmake,Linux源码经bear,kernel-grok生成CmakeList.txt后还要定制一下导入才勉强用
clion 2020.2 支持 Makefile工程一步到位直接导入
https://github.com/microsoft/WSL2-Linux-Kernel
下面 Build Instructions,加上个编译时缺少的 bc
apt install build-essential flex bison dwarves libssl-dev libelf-dev bc
make KCONFIG_CONFIG=Microsoft/config-wsl -j$(nproc)
早期会要设置一些如
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -nostdinc")
add_definitions(-D__KERNEL__=1)
include/generated/autoconfig.h 手动add_definitions
ref
http://ybin.cc/tools/clion-for-linux-driver-developer/