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] enable CMP0144 policy if available #96589

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

jerryzj
Copy link
Contributor

@jerryzj jerryzj commented Jun 25, 2024

  • Enable CMP0144 policy if available, this will make the find_package() more robust.

- Enable CMP0144 policy if available, this will make the find_package()
  more robust.

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
@jerryzj jerryzj requested review from mstorsjo and MaskRay June 25, 2024 04:23
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Jun 25, 2024
@jerryzj
Copy link
Contributor Author

jerryzj commented Jun 25, 2024

I was having issue finding Zstd, and enabling this policy can make it works.

Reference: https://projects.blender.org/blender/blender/pulls/119120

@MaskRay
Copy link
Member

MaskRay commented Jun 29, 2024

I use CMake 2.28 and see CMP0144 warnings. This PR will fix that.

However, if I am reading https://cmake.org/cmake/help/latest/policy/CMP0144.html correctly, rg -g '*CMake*' '_ROOT\b', some mlir <PackageName>_ROOT variables need to be ported.

mlir/lib/Target/LLVM/CMakeLists.txt @fabianmcg @joker-eph

@fabianmcg
Copy link
Contributor

@MaskRay are the warnings being caused by mlir/lib/Target/LLVM/CMakeLists.txt?
Because AFAICT mlir/lib/Target/LLVM/CMakeLists.txt is not really affected by the change of policy because the *_ROOT variable in question is: CUDAToolkit_LIBRARY_ROOT, which is defined by find_package(CUDAToolkit) (see CUDAToolkit_LIBRARY_ROOT) and not really a <PACKAGENAME>_ROOT variable.

@MaskRay
Copy link
Member

MaskRay commented Jul 1, 2024

@MaskRay are the warnings being caused by mlir/lib/Target/LLVM/CMakeLists.txt? Because AFAICT mlir/lib/Target/LLVM/CMakeLists.txt is not really affected by the change of policy because the *_ROOT variable in question is: CUDAToolkit_LIBRARY_ROOT, which is defined by find_package(CUDAToolkit) (see CUDAToolkit_LIBRARY_ROOT) and not really a <PACKAGENAME>_ROOT variable.

The warning is from top-level CMakeLists.txt. I think this PR is safe:)

@jerryzj jerryzj merged commit 9f3bfbb into llvm:main Jul 1, 2024
54 of 55 checks passed
@jerryzj jerryzj deleted the dev/jerryzj/add-cmp0144 branch July 1, 2024 17:37
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
- Enable CMP0144 policy if available, this will make the find_package()
more robust.

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
- Enable CMP0144 policy if available, this will make the find_package()
more robust.

Signed-off-by: Jerry Zhang Jian <jerry.zhangjian@sifive.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants