esrlabs / bake

C++ build tool
http://esrlabs.github.io/bake
Other
26 stars 11 forks source link

Bake should escape quotes in compile_commands export #175

Closed vlad-ivanov-name closed 5 years ago

vlad-ivanov-name commented 5 years ago

In compile_commands.json, some macro definitions may contain quotes. They seem to be escaped when starting a process, but not in the compile_commands file.

Example (exported with CMake):

-DESTL_HARD_ASSERT_HEADER=\"ecu_assert.h\"

Same code exported with Bake:

-DESTL_HARD_ASSERT_HEADER="ecu_assert.h" 

The following command may be used to test contents of compile_commands.json:

jq -r '.[] .command' < compile_commands.json | grep -o "\-DESTL_HARD_ASSERT_HEADER=[^ ]*" | head -n1
aschaal commented 5 years ago

Fixed with 2.53.0