Skip to content

[libc++][modules] Adds CMake 3.28 support. #75700

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

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

mordante
Copy link
Member

This is a preparation to start using CMake 3.28 in the CI.

This is a preparation to start using CMake 3.28 in the CI.
@mordante mordante requested a review from a team as a code owner December 16, 2023 15:03
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 16, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 16, 2023

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

Changes

This is a preparation to start using CMake 3.28 in the CI.


Full diff: https://github.com/llvm/llvm-project/pull/75700.diff

1 Files Affected:

  • (modified) libcxx/modules/CMakeLists.txt.in (+8-4)
diff --git a/libcxx/modules/CMakeLists.txt.in b/libcxx/modules/CMakeLists.txt.in
index b02b68915b8f4d..98168673ebfe9c 100644
--- a/libcxx/modules/CMakeLists.txt.in
+++ b/libcxx/modules/CMakeLists.txt.in
@@ -3,12 +3,16 @@ cmake_minimum_required(VERSION 3.26)
 project(libc++-modules LANGUAGES CXX)
 
 # Enable CMake's module support
-if(CMAKE_VERSION VERSION_LESS "3.27.0")
-  set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a")
+if(CMAKE_VERSION VERSION_LESS "3.28.0")
+  if(CMAKE_VERSION VERSION_LESS "3.27.0")
+    set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "2182bf5c-ef0d-489a-91da-49dbc3090d2a")
+  else()
+    set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
+  endif()
+  set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
 else()
-  set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
+  cmake_policy(VERSION 3.28)
 endif()
-set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
 
 # Default to C++ extensions being off. Libc++'s modules support have trouble
 # with extensions right now.

@mordante mordante merged commit 3b07058 into llvm:main Dec 18, 2023
@mordante mordante deleted the module_cmake3.28_support branch December 18, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants