Merge branch 'doc/eclipse_setup_v3.1' into 'release/v3.1'

doc: eclipse setup (v3.1 backport)

See merge request idf/esp-idf!2679
This commit is contained in:
Angus Gratton 2018-07-11 14:31:31 +08:00
commit 3e5053b778
4 changed files with 37 additions and 16 deletions

View file

@ -43,7 +43,7 @@ Project Properties
* Click on the "C/C++ Build" properties page (top-level):
* Uncheck "Use default build command" and enter this for the custom build command: ``python ${IDF_PATH}/tools/windows/eclipse_make.py``.
* Uncheck "Use default build command" and enter this for the custom build command: ``python ${IDF_PATH}/tools/windows/eclipse_make.py``
* Click on the "Environment" properties page under "C/C++ Build":
@ -57,12 +57,14 @@ Project Properties
* Click the "Providers" tab
* In the list of providers, click "CDT GCC Built-in Compiler Settings Cygwin". Under "Command to get compiler specs", replace the text ``${COMMAND}`` at the beginning of the line with ``xtensa-esp32-elf-gcc``. This means the full "Command to get compiler specs" should be ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
* In the list of providers, click "CDT Cross GCC Built-in Compiler Settings". Change "Command to get compiler specs" to ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
* In the list of providers, click "CDT GCC Build Output Parser" and type ``xtensa-esp32-elf-`` at the beginning of the Compiler command pattern, and wrap remaining part with brackets. This means the full Compiler command pattern should be ``xtensa-esp32-elf-((g?cc)|([gc]\+\+)|(clang))``
* In the list of providers, click "CDT GCC Build Output Parser" and change the "Compiler command pattern" to ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
Navigate to "C/C++ General" -> "Indexer" property page:
* Check "Enable project specific settings" to enable the rest of the settings on this page.
* Uncheck "Allow heuristic resolution of includes". When this option is enabled Eclipse sometimes fails to find correct header directories.
Building in Eclipse

View file

@ -59,12 +59,14 @@ Navigate to "C/C++ General" -> "Preprocessor Include Paths" property page:
* Click the "Providers" tab
* In the list of providers, click "CDT Cross GCC Built-in Compiler Settings". Under "Command to get compiler specs", replace the text ``${COMMAND}`` at the beginning of the line with ``xtensa-esp32-elf-gcc``. This means the full "Command to get compiler specs" should be ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
* In the list of providers, click "CDT Cross GCC Built-in Compiler Settings". Change "Command to get compiler specs" to ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``.
* In the list of providers, click "CDT GCC Build Output Parser" and type ``xtensa-esp32-elf-`` at the beginning of the Compiler command pattern. This means the full Compiler command pattern should be ``xtensa-esp32-elf-(g?cc)|([gc]\+\+)|(clang)``
* In the list of providers, click "CDT GCC Build Output Parser" and change the "Compiler command pattern" to ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
Navigate to "C/C++ General" -> "Indexer" property page:
* Check "Enable project specific settings" to enable the rest of the settings on this page.
* Uncheck "Allow heuristic resolution of includes". When this option is enabled Eclipse sometimes fails to find correct header directories.
.. _eclipse-build-project:

View file

@ -40,17 +40,17 @@ Windows 平台上的 Eclipse 配置
项目属性
----------
* 新项目将出现在 “Project Explorer” 下。请右键选择该项目并在菜单中选择顶层 “Properties”。
* 新项目将出现在 “Project Explorer” 下。请右键选择该项目并在菜单中选 “Properties”。
* 点击 “C/C++ Build” 属性页。
* 取消选中 “Use default build command”然后输入命令``python ${IDF_PATH}/tools/windows/eclipse_make.py``,开始自定义创建。
* 取消选中 “Use default build command”然后输入命令开始自定义创建``python ${IDF_PATH}/tools/windows/eclipse_make.py``
* 点击 “C/C++ Build” 下的 “Environment” 属性页面。
* 选择 “Add...”,并在对应位置输入 ``BATCH_BUILD````1``
* 再次点击 “Add...”,输入名称 ``IDF_PATH``,并填写 ESP-IDF 的完整安装路径。``IDF_PATH`` 目录路径应使用正斜杠,而非反斜线, ``C:/Users/MyUser/Development/esp-idf``
* 再次点击 “Add...”,输入名称 ``IDF_PATH``,并填写 ESP-IDF 的完整安装路径。``IDF_PATH`` 目录路径应使用正斜杠,而非反斜线,例如 ``C:/Users/MyUser/Development/esp-idf``
* 选择 PATH 环境变量,删除默认值,并将其替换为 ``C:\msys32\usr\bin;C:\msys32\mingw32\bin;C:\msys32\opt\xtensa-esp32-elf\bin`` (如果您已经将 msys32 安装到其他目​​录,这里请自行调整)。
@ -58,11 +58,18 @@ Windows 平台上的 Eclipse 配置
* 点击 “C/C++ General” -> “Preprocessor Include Paths, Macros, etc.” 属性页。
* 点击 “Providers” 选项卡。
* 从 “Providers” 列表中选择 “CDT GCC Built-in Compiler Settings Cygwin”。在 “Command to get compiler specs” 输入框中,用 ``xtensa-esp32-elf-gcc`` 替换行首的 ``${COMMAND}``,最终完整的 ``Command to get compiler specs`` 应为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``
* 从 “Providers” 列表中选择 “CDT Cross GCC Built-in Compiler Settings”将 “Command to get compiler specs” 修改为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”然后在 Compiler 命令模式的起始位置输入 ``xtensa-esp32-elf-``,并用括号把剩余部分扩起来。最终的完整 Compiler 命令模式应为 ``xtensa-esp32-elf-((g?cc)|([gc]\+\+)|(clang))``
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”将 “Compiler command pattern” 修改为 ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
点击 “C/C++ General" -> "Indexer” 属性页。
* 选择 “Enable project specific settings” 以启用本页上的其他设置。
.. note::
取消选中 “Allow heuristic resolution of includes”。因为启用此选项时有时会导致 Eclipse 无法找到正确的头文件目录。
在 Eclipse IDE 中创建项目
---------------------------

View file

@ -57,14 +57,24 @@ Windows 用户
* 前往 “C/C++ General” -> “Preprocessor Include Paths” 属性页面。
* 点击 “Providers” 选项卡。从 “Providers” 列表中选择 “CDT Cross GCC Built-in Compiler Settings”。在 “Command to get compiler specs” 输入框中,用 ``xtensa-esp32-elf-gcc`` 替换行首的 ``${COMMAND}``,最终的完整 “Command to get compiler specs” 应为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”然后在 “Compiler command pattern“ 输入框的起始位置输入 ``xtensa-esp32-elf-``,最终的完整编译器命令应为 ``xtensa-esp32-elf-(g?cc)|([gc]\+\+)|(clang)``
* 点击 “Providers” 选项卡。
* 从 “Providers” 列表中选择 “CDT Cross GCC Built-in Compiler Settings”将 “Command to get compiler specs” 修改为 ``xtensa-esp32-elf-gcc ${FLAGS} -E -P -v -dD "${INPUTS}"``
* 从 “Providers” 列表中选择 “CDT GCC Build Output Parser”将 “Compiler command pattern” 修改为 ``xtensa-esp32-elf-(gcc|g\+\+|c\+\+|cc|cpp|clang)``
* 前往 “C/C++ General” -> “Indexer” 属性页面。
* 去除 "Allow heuristic resolution of includes" 勾选。启用此选项时Eclipse 有时无法找到正确的头文件目录。
点击 “C/C++ General" -> "Indexer” 属性页。
* 选择 “Enable project specific settings” 以启用本页上的其他设置。
.. note::
取消选中 “Allow heuristic resolution of includes”。因为启用此选项时有时会导致 Eclipse 无法找到正确的头文件目录。
.. _eclipse-build-project:
在 Eclipse IDE 中创建项目
@ -89,11 +99,11 @@ Windows 用户
* 打开 “Project Explorer”并右击您的项目请注意右击项目本身而非项目下的子文件否则 Eclipse 可能会找到错误的 ``Makefile``)。
* 从菜单中选择 “Make Targets” -> “Create”。
* 从菜单中选择 “Build Targets” -> “Create”。
* 输入 “flash” 为目标名称,其他选项使用默认值。
* 选择 “Project” -> “Make Target” -> “Build (快捷键Shift + F9创建自定义烧录目标用于编译、烧录项目。
* 选择 “Project” -> “Build Target” -> “Build (快捷键Shift + F9创建自定义烧录目标用于编译、烧录项目。
注意,您将需要通过 ``make menuconfig``,设置串行端口和其他烧录选项。``make menuconfig`` 仍需通过命令行操作(请见平台的对应指南)。