lld-link.exe error "could not open /LTCG:incremental: no such file or directory"

I have the “/LTCG:incremental” flag turned on in VS2017 Linker options and I’m trying to build with the LLVM toolset. But I have the linker error mentioned in the title coming from lld-link.exe. Why does it think it’s an input file and how do I tell it that it isn’t? Note: I’m using clang-cl.exe as the compiler.

Don’t pass that flag, lld-link doesn’t recognize it. If you want LTCG with llvm you need to pass -flto=thin on clang-cl, and delete the linker argument