From a82f4eabaaa0200f69c80c5c41853f36d9564693 Mon Sep 17 00:00:00 2001 From: Gregor Copoix Date: Wed, 20 Mar 2024 14:44:47 +0100 Subject: [PATCH 1/2] fixed VS Code workspace file after v9 upate - fixed the make command (use cmake --build instead of make to be independent from cmake generator) - fixed launched executable path - added recommendation for cmake extension --- README.md | 6 +++--- simulator.code-workspace | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 51e644e..f50494e 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The [LVGL](https://github.com/lvgl/lvgl) is written mainly for microcontrollers ## Requirements This project is configured for [VSCode](https://code.visualstudio.com) and only tested on Linux, although this may work on OSx or WSL. It requires a working version of GCC, GDB and make in your path. -To allow debugging inside VSCode you will also require a GDB [extension](https://marketplace.visualstudio.com/items?itemName=webfreak.debug) or other suitable debugger. All the requirements have been pre-configured in the [.workspace](simulator.code-workspace) file (simply open the project by doubleclick on this file). +To allow debugging inside VSCode you will also require a GDB [extension](https://marketplace.visualstudio.com/items?itemName=webfreak.debug) or other suitable debugger. All the requirements, build and debug settings have been pre-configured in the [.workspace](simulator.code-workspace) file (simply open the project by doubleclick on this file). The project can use **SDL** but it can be easily relaced by any other built-in LVGL dirvers. @@ -20,7 +20,7 @@ git clone --recursive https://github.com/lvgl/lv_port_pc_vscode ``` ### Install graphics driver - + Please make sure **SDL** is installed in the system: #### Install SDL @@ -51,4 +51,4 @@ git checkout release/6.0 ./configure --disable-all --disable-autodetect --disable-podpages --disable-asm --enable-avcodec --enable-avformat --enable-decoders --enable-encoders --enable-demuxers --enable-parsers --enable-protocol='file' --enable-swscale --enable-zlib make sudo make install -``` \ No newline at end of file +``` diff --git a/simulator.code-workspace b/simulator.code-workspace index a2416e4..60572a9 100644 --- a/simulator.code-workspace +++ b/simulator.code-workspace @@ -13,6 +13,7 @@ "recommendations": [ "ms-vscode.cpptools", // common C/C++ support "ms-vscode.cpptools-themes", // general C/C++ theme + "ms-vscode.cmake-tools" // cmake support ], "unwantedRecommendations": [ ] @@ -36,7 +37,10 @@ "tasks": [ { "label": "Build", - "command": "make", + "command": "cmake", + "args": [ + "--build", "${command:cmake.buildDirectory}" + ], "group": { "kind": "build", "isDefault": true @@ -64,9 +68,9 @@ "name": "Debug LVGL demo with gdb", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/build/bin/demo", + "program": "bin/main", "args": [], - "cwd": "${fileDirname}", + "cwd": "${workspaceFolder}", "preLaunchTask": "Build", "stopAtEntry": false, }, From 4dc6b04eb8d69672af75a3ecc26eecc65d66f76e Mon Sep 17 00:00:00 2001 From: Gregor Copoix Date: Sat, 23 Mar 2024 16:52:18 +0100 Subject: [PATCH 2/2] cleanup, full path to executable --- simulator.code-workspace | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/simulator.code-workspace b/simulator.code-workspace index 60572a9..191fb59 100644 --- a/simulator.code-workspace +++ b/simulator.code-workspace @@ -23,13 +23,7 @@ "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "files.trimFinalNewlines": true, - "cmake.configureOnOpen": false, - "files.associations": { - "lv_demos.h": "c", - "lvgl.h": "c", - "lv_drv_conf.h": "c", - "stdlib.h": "c" - }, + "cmake.configureOnOpen": true, }, // tasks.json section "tasks": { @@ -68,7 +62,7 @@ "name": "Debug LVGL demo with gdb", "type": "cppdbg", "request": "launch", - "program": "bin/main", + "program": "${workspaceFolder}/bin/main", "args": [], "cwd": "${workspaceFolder}", "preLaunchTask": "Build",