[libcxx-commits] [libcxx] [libc++][modules] Adds CMake 3.28 support. (PR #75700)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 16 07:04:11 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

<details>
<summary>Changes</summary>

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
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.

``````````

</details>


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


More information about the libcxx-commits mailing list