View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015952CMakeCMakepublic2016-02-03 20:132016-06-10 14:31
ReporterChaoren Lin 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.4.2 
Target VersionFixed in Version 
Summary0015952: '$' becomes '$$' in compile_commands.json
DescriptionIf your compile command contains a '$' character, it'll be incorrectly emitted as '$$' in compile_commands.json if CMAKE_EXPORT_COMPILE_COMMANDS is enabled.
Steps To Reproduce1) extract example.zip
2) cd example && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=True .
3) make VERBOSE=1
4) see that the compile command is

/usr/bin/cc -DFOO="\"\$\"" -o CMakeFiles/foo.dir/foo.c.o -c /tmp/cmake/foo.c

5) open up compile_commands.json
6) see

"command": "/usr/bin/cc -DFOO=\"\\\"\\$$\\\"\" -o CMakeFiles/foo.dir/foo.c.o -c /tmp/cmake/foo.c"

which is wrong, since it should be $ instead of $$.
TagsNo tags attached.
Attached Fileszip file icon example.zip [^] (457 bytes) 2016-02-03 20:13

 Relationships

  Notes
(0040439)
Brad King (manager)
2016-02-04 08:36

The compile commands are generated here:

 https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmMakefileTargetGenerator.cxx;hb=v3.4.3#l638 [^]

Trace from there to see where it gets the values. Some of the code paths may be meant for generating Makefile content and is applying the relevant escapes.
(0042932)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-03 20:13 Chaoren Lin New Issue
2016-02-03 20:13 Chaoren Lin File Added: example.zip
2016-02-04 08:36 Brad King Note Added: 0040439
2016-06-10 14:29 Kitware Robot Note Added: 0042932
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team