This ends up in INTERFACE_LINK_LIBRARIES, and then ninja thinks it's a file:
ninja: error: '/defaultlib:msvcrt', needed by 'cpp-exe.exe', missing and no known rule to make it
This check to see if libraries start with a slash, and then assuming that they are a flag, and putting those in INTERFACE_LINK_OPTIONS instead. If there is some better way to detect flags, I'm all for it. We could also have it have anything that starts with - but not start with -l be detected as a flag, but that seems a bit more likely to be disruptive.
I checked commandlines and it does indeed get propaged properly to the commandline.
As of https://github.com/rust-lang/rust/pull/122268, rust emits /defaultlib:msvcrt in native-static-libs
This ends up in INTERFACE_LINK_LIBRARIES, and then ninja thinks it's a file:
ninja: error: '/defaultlib:msvcrt', needed by 'cpp-exe.exe', missing and no known rule to make it
This check to see if libraries start with a slash, and then assuming that they are a flag, and putting those in INTERFACE_LINK_OPTIONS instead. If there is some better way to detect flags, I'm all for it. We could also have it have anything that starts with
-
but not start with-l
be detected as a flag, but that seems a bit more likely to be disruptive.I checked commandlines and it does indeed get propaged properly to the commandline.