Automatically escape string characters used in cflags
- Dominant language
- Python
- Stars
- 11
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Right now, if a macro definition is set to a string, it will fail:
```yaml
cflags:
- -DAMQ_PLATFORM="unix"
```
This is because the double quotes will go unescaped into the CMakeLists.txt file, which will cause the compilation to fail. However this works:
```yaml
cflags:
- -DAMQ_PLATFORM=\\\"unix\\\"
```
Really ugly, cpm should automatically escape double quotes and conflicting characters so that the CMakeLists.txt is built correctly.
Contributor guide
Research direction
Trace how the cflags values from the YAML configuration are written into the CMakeLists.txt file. Reproduce the quoted macro example and compare it with the manually escaped form. Done means string and conflicting characters are escaped automatically so the generated CMakeLists.txt compiles correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100