Skip to content

Fix XcodeToolchain extra flags getting overwritten across configurations - #20255

Open
czoido wants to merge 6 commits into
conan-io:develop2from
czoido:fix-xcodetoolchain-flags-multiconfig
Open

Fix XcodeToolchain extra flags getting overwritten across configurations#20255
czoido wants to merge 6 commits into
conan-io:develop2from
czoido:fix-xcodetoolchain-flags-multiconfig

Conversation

@czoido

@czoido czoido commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Changelog: Fix: XcodeToolchain's extra flags (tools.build:cflags/cxxflags/ldflags/defines) no longer get overwritten when installing more than one configuration for the same project.
Docs: TODO

Running conan install twice for the same project, once per build_type, with
tools.build:cxxflags set to a different value each time:

conan install . -s build_type=Debug   -c tools.build:cxxflags=["-DDEBUG_FLAG"]
conan install . -s build_type=Release -c tools.build:cxxflags=["-DRELEASE_FLAG"]

overwrites the generated file conan_global_flags.xcconfig entirely on the
second install. Only -DRELEASE_FLAG remains afterwards and -DDEBUG_FLAG is gone.
Both the Debug and Release configurations in the resulting Xcode project end
up using -DRELEASE_FLAG, regardless of which one is actually built. No error
or warning is produced.

Other settings XcodeToolchain writes (C++ standard, minimum OS version, etc.) don't have this problem, each configuration keeps its own value after multiple installs. Only the extra flags confs (cxxflags, cflags, ldflags, defines) are affected.

@czoido
czoido marked this pull request as ready for review August 14, 2026 13:11
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.

2 participants