user3927312
user3927312

Reputation: 824

I need to add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to cmake permanently

I use llvm for a few projects and I'd like to add this command line argument along with the path to llvm to my cmake permanently so I don't have to keep using it every time I run cmake. I'd also prefer that cmake doesn't break when using it for projects which don't involve llvm.

Thanks

Upvotes: 0

Views: 235

Answers (1)

Cinder Biscuits
Cinder Biscuits

Reputation: 5261

You can add it to CMakeLists.txt directly. Simply add somewhere near the top of the project:

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Not quite what you had in mind, but other than writing a script to run the command with flags, i don't think it's possible.

Upvotes: 4

Related Questions