Skip to content

Add build_src_unflags for project builds - #5549

Open
hariomkhonde108 wants to merge 1 commit into
platformio:developfrom
hariomkhonde108:feature/build-src-unflags
Open

hariomkhonde108 wants to merge 1 commit into
platformio:developfrom
hariomkhonde108:feature/build-src-unflags

Conversation

@hariomkhonde108

Copy link
Copy Markdown

Closes #5547.

Adds build_src_unflags (also configurable with PLATFORMIO_BUILD_SRC_UNFLAGS). It removes flags from the project build environment after applying build_src_flags, using the existing flag-removal code. Libraries and frameworks retain their own build flags.

[env]
build_flags = -w
build_src_unflags = -w
build_src_flags = -Wall -Werror

The native build regression test checks that a globally defined macro is removed when compiling project sources and remains defined when compiling a project library. The regression passed on Windows. The adjacent existing test_build_unflags failed on Windows because it emits a backslash-containing path as an unescaped Python string in its generated script.

Copilot AI balanced review requested due to automatic review settings November 27, 2026 10:28
@CLAassistant

CLAassistant commented Nov 27, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

Feature suggestion: build_src_unflags

3 participants