[cmake-developers] [CMake 0015952]: '$' becomes '$$' in compile_commands.json

Mantis Bug Tracker mantis at public.kitware.com
Wed Feb 3 20:13:49 EST 2016


The following issue has been SUBMITTED. 
====================================================================== 
https://cmake.org/Bug/view.php?id=15952 
====================================================================== 
Reported By:                Chaoren Lin
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15952
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2016-02-03 20:13 EST
Last Modified:              2016-02-03 20:13 EST
====================================================================== 
Summary:                    '$' becomes '$$' in compile_commands.json
Description: 
If 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 Reproduce: 
1) 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 $$.
====================================================================== 

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                      
======================================================================



More information about the cmake-developers mailing list