Skip to content

Refactored the build logic to improve build with freeRTOS and in VSCode - #109

Open
Spider84 wants to merge 1 commit into
lvgl:masterfrom
Spider84:tidy/freertos-build
Open

Refactored the build logic to improve build with freeRTOS and in VSCode#109
Spider84 wants to merge 1 commit into
lvgl:masterfrom
Spider84:tidy/freertos-build

Conversation

@Spider84

@Spider84 Spider84 commented Feb 11, 2026

Copy link
Copy Markdown
  • Removed colors from CMake output under VSCode (VSCode Output window can't show ASCI colors)
  • Changed ${SDL2_LIBRARIES} to SDL2::SDL2 to fix SDL2main link error on Windows.
  • freeRTOS build dependencies for Windows and Posix builds

Summary by cubic

Refactored the CMake build to improve FreeRTOS builds on Windows and Posix and make VSCode builds clearer. Also fixed SDL2 linking issues on Windows.

  • Refactors

    • Detect VSCode and disable CMake color output for readable logs.
    • Select FreeRTOS port per platform: MSVC/MingW on Windows, GCC Posix otherwise.
    • Include the correct FreeRTOS port sources via FREERTOS_PORT_PATH.
    • Auto-set LV_USE_OS to FreeRTOS when FreeRTOS headers are present.
    • Guard main entry points: use freertos_main for FreeRTOS, main.c otherwise.
    • Link SDL via SDL2::SDL2 target instead of SDL2_LIBRARIES.
  • Bug Fixes

    • Resolve SDL2main link error on Windows by linking to SDL2::SDL2.

Written for commit 6c85807. Summary will update on new commits.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 4 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/freertos_main.c">

<violation number="1" location="src/freertos_main.c:9">
P2: The FreeRTOS guard is evaluated before LVGL config macros are defined, so it always passes and defeats the intended OS gating.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/freertos_main.c
*/

#include "lvgl/lvgl.h"
#if LV_USE_OS == LV_OS_FREERTOS

@cubic-dev-ai cubic-dev-ai Bot Feb 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The FreeRTOS guard is evaluated before LVGL config macros are defined, so it always passes and defeats the intended OS gating.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/freertos_main.c, line 9:

<comment>The FreeRTOS guard is evaluated before LVGL config macros are defined, so it always passes and defeats the intended OS gating.</comment>

<file context>
@@ -6,15 +6,18 @@
  */
 
-#include "lvgl/lvgl.h"
+#if LV_USE_OS == LV_OS_FREERTOS
 
 #include "FreeRTOS.h"
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant