Possible Bug: Incorrect location of <LINK_FLAGS> and <LINK_LIBRARIES> in CMAKE_${lang}_LINK_EXECUTABLE for IntelLLVM on Windows.

Modules\Platform\Windows-IntelLLVM.cmake on line 43 puts <LINK_FLAGS> and <LINK_LIBRARIES> before /link.

Is this on purpose?

It forces all linker options set up via the LINK_OPTIONS target property to be “escaped” by the LINKER: tag because they get passed to the compiler as compiler flags, not linker flags.

Yes, it is intentional. See commit 5d5a712303 (IntelLLVM: Pass linker flags to the compiler when used as linker, 2022-05-27, v3.25.0-rc1~344^2~4) from MR 7533.

Running the linker through the compiler driver is typical on most non-Windows platforms. Adding the LINKER: prefix to pass linker options through the compiler driver is normal practice.

Thank you for the explanation.