【esp32】手动设置windows defender排除项,加快build速度

当我们安装好esp32开发环境后,发现build速度极慢,打开任务管理器,发现windows defender占了一半的cpu,这时手动设置windows defender排除项,可加快编译速度3~5倍。
设置方法出自github,如下:

The quick way to exclude everything in .espressif/tools (PowerShell command):

Invoke-WebRequest 'https://dl.espressif.com/dl/idf-env/idf-env.exe' -OutFile .\idf-env.exe
.\idf-env.exe antivirus exclusion add --all

The command will produce the same behavior as PowerShell script in the previous installer.

Command to remove all exclusions:

.\idf-env.exe antivirus exclusion remove --all

It’s possible to register a single tool from .espresif/tool by command (e.g. cmake):

.\idf-env.exe antivirus exclusion add --tool cmake

It’s possible to register a single Path and Process exclusion by:

.\idf-env.exe antivirus exclusion add --path "C:\Users\esp\....\ar.exe"

The tool also contains support for measuring build time (requires IDF installed by Installer 2.7+):

idf-env idf build --repeat 10

The command repeats fullclean and build of blink example ten times. Results on build time became stable after the 2nd build.

你可能感兴趣的:(嵌入式开发,esp32)