Skip to content

Escape quotes for XCodeDeps generator - #11039

Merged
czoido merged 3 commits into
conan-io:developfrom
czoido:fix_xcodedeps_escapes
Apr 19, 2022
Merged

czoido merged 3 commits into
conan-io:developfrom
czoido:fix_xcodedeps_escapes

Conversation

@czoido

@czoido czoido commented Apr 18, 2022

Copy link
Copy Markdown
Contributor

Changelog: Fix: Escape quotes in XCodeDeps generator.
Docs: omit

Testing the imgui recipe from Conan Center looks like XCode won't accept the defines generated in the xcconfig files because quote character is not properly escaped.

Related to: #11013

@czoido czoido added this to the 1.48 milestone Apr 18, 2022
@StellaSmith

Copy link
Copy Markdown

I would recommend using shlex.quote

@memsharded

Copy link
Copy Markdown
Member

I would recommend using shlex.quote

But this is for an Xcode build file, not for terminal:

// Definition of Conan variables for {{name}}
        CONAN_{{name}}_BINARY_DIRECTORIES{{condition}} = {{bin_dirs}}
        CONAN_{{name}}_C_COMPILER_FLAGS{{condition}} = {{c_compiler_flags}}

Are the xcode build scripts variable values supposed to be escaped following the shell escaping?

@StellaSmith

Copy link
Copy Markdown

I thought it worked the same way as a .pc file, just copy pasting the variable into a command line

@memsharded

Copy link
Copy Markdown
Member

I thought it worked the same way as a .pc file, just copy pasting the variable into a command line

I think Xcode is a more advanced and complex build system and does many other things, beyond what a .pc /pkg-config does, that was the reason of my question. Maybe the best is to keep the current proposal of just scaping the quotes, and not the full shlex.quote alternative.

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.

3 participants