-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Problem
Thanks to cargo implementing the jobserver protocol (#1744), you can already call cargo from a GNU make build and have both build systems figure out how many parallel jobs can be started at a given time. All you have to do is prefix the GNU Make recipe line in which cargo is invoked with a +.
Unfortunately, this has a nasty side effect: If you (or your IDE 1) only want to know what GNU Make would execute and start make -n, then make executes cargo anyway, assuming that sub-makes will know how to handle the MAKEFLAGS appropriately. Unfortunately, cargo actually completely ignores the presence of n in MAKEFLAGS and starts building stuff, which is the exact opposite of what the user wanted.
Proposed Solution
If n is present in MAKEFLAGS, cargo should only print the processes it would normally execute instead of actually executing build processes.
Notes
Relevant GNU Make documentation:
Footnotes
-
CLion, for example, does this when importing Makefile projects ↩