Skip to content

Quotes got swallowed in compile_commands.json [BUG] #1334

Closed
@tgeng

Description

@tgeng
  • NDK Version: 21.2.6472646
  • Build system: ndk-build
  • Host OS: gLinux

Any project using NDK would do. Take the ndk-build hello-jni as an example.

Repro instruction:

  1. download https://github.com/android/ndk-samples/tree/master/other-builds/ndkbuild/hello-jni
  2. cd into the project root (<git dir>/other-builds/ndkbuild/hello-jni)
  3. run the following command, which sets a custom macro fooyoo=a + b.
    /usr/local/google/home/tgeng/Android/Sdk/ndk/21.2.6472646/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=`pwd`/app/Android.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=/tmp/junk-123 NDK_LIBS_OUT=/tmp/junk-123 'APP_CFLAGS+=-Dfooyoo="a + b"' APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B compile_commands.json
  4. open the generated compile_commands.json and it contains -Dfooyoo=a + b, which won't work since a + b is not quoted.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions