Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMake]: Use check_linker_flag for /DEPENDENTLOADFLAG #2301

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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