This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Fixes using CMake 3.27.0.
ClosedPublic

Authored by Mordante on Jun 10 2023, 4:48 AM.

Details

Summary

Testing libc++ with CMake 3.27.0-rc1 fails. It seems some of the modules
used in CMake are not included.

The error before this change was

CMake Error at <mono-repo>/llvm/cmake/modules/HandleLLVMOptions.cmake:821 (CHECK_C_SOURCE_COMPILES):
  Unknown CMake command "CHECK_C_SOURCE_COMPILES".
Call Stack (most recent call first):
  CMakeLists.txt:156 (include)

Diff Detail

Event Timeline

Mordante created this revision.Jun 10 2023, 4:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 4:48 AM
Herald added a subscriber: ekilmer. · View Herald Transcript
Mordante requested review of this revision.Jun 10 2023, 4:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 4:48 AM
kwk added a comment.Jun 12 2023, 3:19 AM

Can you please how things fail? What is the error message for example?

Mordante edited the summary of this revision. (Show Details)Jun 12 2023, 5:35 AM

Can you please how things fail? What is the error message for example?

Good point! I updated the commit message.

kwk added a comment.Jun 12 2023, 7:49 AM

Can you please how things fail? What is the error message for example?

Good point! I updated the commit message.

Thank you.

Can I assume that the follow-up error after adding include(CheckCSourceCompiles) is similar but with CHECK_CXX_SOURCE_COMPILES?

Could this be an error in CMake itself that should be fixed upstream?

Can you please how things fail? What is the error message for example?

Good point! I updated the commit message.

Thank you.

Can I assume that the follow-up error after adding include(CheckCSourceCompiles) is similar but with CHECK_CXX_SOURCE_COMPILES?

Could this be an error in CMake itself that should be fixed upstream?

Based on the documentation https://cmake.org/cmake/help/latest/module/CheckCSourceCompiles.html this module provides CHECK_C_SOURCE_COMPILES. So I think we forgot an include and it just happened to work.

I expect this https://github.com/Kitware/CMake/commit/03c6ebf2b53956d9d8d035f9bf67bb73caca65f3 caused the issue
CheckCCompilerFlag.cmake removed its CheckCSourceCompiles include.

thesamesam accepted this revision.Jun 12 2023, 8:39 AM
thesamesam added a subscriber: thesamesam.

Yes, it's a transitive include which just happened to work before.

See https://reviews.llvm.org/D152622 for CheckCSourceCompiles. I'd missed this change set.

This revision is now accepted and ready to land.Jun 12 2023, 8:39 AM
This revision was automatically updated to reflect the committed changes.