# Possible Bug: Incorrect location of \<LINK\_FLAGS\> and \<LINK\_LIBRARIES\> in CMAKE\_${lang}\_LINK\_EXECUTABLE for IntelLLVM on Windows.

**URL:** https://discourse.cmake.org/t/possible-bug-incorrect-location-of-link-flags-and-link-libraries-in-cmake-lang-link-executable-for-intelllvm-on-windows/15779
**Category:** Development
**Created:** [August 5, 2026, 10:58pm UTC](https://discourse.cmake.org/t/possible-bug-incorrect-location-of-link-flags-and-link-libraries-in-cmake-lang-link-executable-for-intelllvm-on-windows/15779 "2026-08-05T22:58:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![marco1475](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@marco1475](https://discourse.cmake.org/u/marco1475)
#### Post date: [August 5, 2026, 10:58pm UTC](https://discourse.cmake.org/t/possible-bug-incorrect-location-of-link-flags-and-link-libraries-in-cmake-lang-link-executable-for-intelllvm-on-windows/15779/1 "2026-08-05T22:58:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [August 6, 2026, 12:49pm UTC](https://discourse.cmake.org/t/possible-bug-incorrect-location-of-link-flags-and-link-libraries-in-cmake-lang-link-executable-for-intelllvm-on-windows/15779/2 "2026-08-06T12:49:03Z")

</div>

Yes, it is intentional. See [commit 5d5a712303](https://gitlab.kitware.com/cmake/cmake/-/commit/5d5a7123034361b6cacff96d3ed20d2bb78c33cc) (IntelLLVM: Pass linker flags to the compiler when used as linker, 2022-05-27, `v3.25.0-rc1~344^2~4`) from [MR 7533](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/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.

---

<div class="post-metadata">

### Author: ![marco1475](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@marco1475](https://discourse.cmake.org/u/marco1475)
#### Post date: [August 6, 2026, 7:53pm UTC](https://discourse.cmake.org/t/possible-bug-incorrect-location-of-link-flags-and-link-libraries-in-cmake-lang-link-executable-for-intelllvm-on-windows/15779/3 "2026-08-06T19:53:33Z")

</div>

Thank you for the explanation.
