Skip to content

Conversation

@Maetveis
Copy link
Contributor

@Maetveis Maetveis commented Nov 8, 2024

PR #2100 changed the WIN32 check to check from if(WIN32) to checking if link.exe is used via CMAKE_CXX_COMPILER_LINKER_ID. This has two problems:

  • CMAKE_CXX_COMPILER_LINKER_ID is only supported starting with CMake 3.29, but UR still claims to CMake versions from 3.20 (cmake_minimum_required is called with this version). This results in the flag being silently dropped in earlier versions of CMake.
  • There are other linkers that also support this flag for example LLD.

Using check_linker_flag resolves these issues without hard-coding a list of known linkers.

PR oneapi-src#2100 changed the WIN32 check to check from `if(WIN32)` to
checking if link.exe is used via `CMAKE_CXX_COMPILER_LINKER_ID`.
This has two problems:
- CMAKE_CXX_COMPILER_LINKER_ID is only supported starting with CMake 3.29,
  but UR still claims to CMake versions from 3.20
  (`cmake_minimum_required` is called with this version).
  This results in the flag being silently dropped in earlier versions of
  CMake.
- There are other linkers that also support this flag for example LLD.

Using check_linker_flag resolves these issues without hard-coding a list
of known linkers.
@Maetveis Maetveis requested a review from a team as a code owner November 8, 2024 14:19
@Maetveis
Copy link
Contributor Author

Maetveis commented Nov 8, 2024

ping @kbenzie

@kbenzie
Copy link
Contributor

kbenzie commented Nov 8, 2024

ping @kbenzie

FYI I'm not a code owner for this change.

@Maetveis
Copy link
Contributor Author

Maetveis commented Nov 8, 2024

@oneapi-src/unified-runtime-level-zero-write

ping @kbenzie

FYI I'm not a code owner for this change.

NP I thought I'd add you as the author of #2100.

@oneapi-src/unified-runtime-level-zero-write

@Maetveis Maetveis closed this Jan 7, 2025
@Maetveis Maetveis deleted the check_linker_flag branch January 7, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants