View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015070 | CMake | CMake | public | 2014-08-07 15:02 | 2015-05-04 09:05 | ||||
Reporter | Vitali | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Apple Mac | OS | OS X | OS Version | 10.4.10 | ||||
Product Version | CMake 3.0 | ||||||||
Target Version | CMake 3.1 | Fixed in Version | CMake 3.1 | ||||||
Summary | 0015070: CMake doesn't escape # properly in add_compile_options with Makefile generator | ||||||||
Description | add_compile_options appears to generate the wrong escape sequence for: add_compile_options("-Wno-error=#warnings") when used in conjuction with the Makefile generator | ||||||||
Steps To Reproduce | add_compile_options("-Wno-error=#warnings") Use makefile generator Look at flags.make: CXX_FLAGS = ... "-Wno-error=#warnings" ... It should be: CXX_FLAGS = "-Wno-error=\#warnings" due to shell-expansion (otherwise # gets treated as a comment). | ||||||||
Additional Information | No amount of escaping in CMake fixes this. It looks like CMake is already aware of \ escaping for the Makefile generator but not for #: add_compile_options("-Wno-error=\#warnings") CXX_FLAGS = ... "-Wno-error=#warnings" ... add_compile_options("-Wno-error=\\#warnings") CXX_FLAGS = ... "-Wno-error=\\#warnings" ... add_compile_options("-Wno-error=\\\#warnings") CXX_FLAGS = ... "-Wno-error=\\#warnings" ... | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |||||||||||||||||||||
|
Relationships |
Notes | |
(0036577) Brad King (manager) 2014-08-07 16:01 |
The _FLAGS variables are written here: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmMakefileTargetGenerator.cxx;hb=v3.0.0#l359 [^] The flags that come from COMPILE_OPTIONS are computed by cmLocalGenerator::AddCompileOptions here: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalGenerator.cxx;hb=v3.0.0#l1447 [^] which uses cmLocalGenerator::AppendFlagEscape: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalGenerator.cxx;hb=v3.0.0#l2347 [^] which uses cmLocalGenerator::EscapeForShell. That is meant for escaping things directly in the shell command part of a make rule. However, in this case it needs to escape for Make syntax in a variable assignment. That does not care about quoting so an extra layer of escaping is needed. |
(0036604) Brad King (manager) 2014-08-12 14:01 |
I've drafted a commit to fix this: Makefile: Handle '#' in COMPILE_OPTIONS http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fbf7a929 [^] |
(0038704) Robert Maynard (manager) 2015-05-04 09:05 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2014-08-07 15:02 | Vitali | New Issue | |
2014-08-07 16:01 | Brad King | Note Added: 0036577 | |
2014-08-12 14:01 | Brad King | Note Added: 0036604 | |
2014-12-04 14:46 | Brad King | Relationship added | related to 0015285 |
2014-12-04 14:47 | Brad King | Relationship replaced | has duplicate 0015285 |
2014-12-04 14:48 | Brad King | Relationship added | related to 0014547 |
2014-12-04 14:48 | Brad King | Relationship added | related to 0013562 |
2014-12-04 14:51 | Brad King | Assigned To | => Brad King |
2014-12-04 14:51 | Brad King | Status | new => resolved |
2014-12-04 14:51 | Brad King | Resolution | open => fixed |
2014-12-04 14:51 | Brad King | Fixed in Version | => CMake 3.1 |
2014-12-04 14:51 | Brad King | Target Version | => CMake 3.1 |
2014-12-22 13:21 | Brad King | Relationship added | related to 0015322 |
2015-05-04 09:05 | Robert Maynard | Note Added: 0038704 | |
2015-05-04 09:05 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |