Trent
Trent

Reputation: 131

CMake command line arguments in a Ninja build

I am trying to use Ninja + CMake to build a project.

This project has a custom target that takes additional arguments.

E.g. make target option=value

It works fine in make, however I am not sure how to get Ninja to take in additional command line arguments. Is this possible with a Ninja build?

Upvotes: 4

Views: 5040

Answers (1)

escrafford
escrafford

Reputation: 2403

I don't think it's possible to do directly through Ninja. I just scanned through the Ninja documentation to double check and didn't see anything.

Instead, you could modify CMake cache variables via CMake (see cmake -D and cmake -L). That way you could change your build on the fly, or create a few different build directories with different settings in each one.

Upvotes: 3

Related Questions