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

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 16 07:03:40 PST 2023


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

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

>From c4519418646a8b291898cc8fbe5fdd7942a618c5 Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Sat, 16 Dec 2023 16:01:45 +0100
Subject: [PATCH] [libc++][modules] Adds CMake 3.28 support.

This is a preparation to start using CMake 3.28 in the CI.
---
 libcxx/modules/CMakeLists.txt.in | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

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.



More information about the libcxx-commits mailing list