Compile database and Xcode (ObjC)

Hi, i’m working with libtooling for Objective-C. My problem is Xcode. I generate the compile_commands.json with the following command:

xcodebuild -scheme “EMA - In House” | xcpretty -r json-compilation-database --output compile_commands.json

at the moment of running my tool

~/llvm-project/build/Debug/bin/clang-my-tool MyClass.m

it shows me the following:

error: unknown argument: ‘-index-store-path’

if i disable the related option in xcode, generate gain the compile_commands.json and run again the tool, another error prompt out:

fatal error: no handler registered for module format ‘obj’
LLVM ERROR: unknown module format

Is really annoying. I just want to process all the files under a project in xcode.

Any of you guys know how to fix this? what i’m doing wrong here?