Skip to content

Commit d94cde8

Browse files
committed
Adding CMake version support ranges
Adding the supported version ranges to each project. The newer versions of CMake have better support with some of the newer policies. Specifically CMP0157 in CMake 3.29 improves the incremental rebuild performance and hooks up the emissions of compile commands for Swift so that folks with Sourcekit-LSP can have a better editing experience.
1 parent 8332998 commit d94cde8

File tree

5 files changed

+5
-12
lines changed

5 files changed

+5
-12
lines changed

1_single_executable/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# See https://swift.org/LICENSE.txt for license information
77

8-
cmake_minimum_required(VERSION 3.22)
8+
cmake_minimum_required(VERSION 3.22...3.29)
99

1010
project(hello LANGUAGES Swift)
1111

2_executable_library/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# See https://swift.org/LICENSE.txt for license information
77

8-
cmake_minimum_required(VERSION 3.22)
8+
cmake_minimum_required(VERSION 3.22...3.29)
99
project(Project2 LANGUAGES Swift)
1010

1111
add_subdirectory("lib/")

3_bidirectional_cxx_interop/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# See https://swift.org/LICENSE.txt for license information
77

8-
cmake_minimum_required(VERSION 3.26)
8+
cmake_minimum_required(VERSION 3.26...3.29)
99

1010
# Project PingPong: Bouncing control flow between Swift and C++ like a ping pong
1111
# ball.

4_swift_macros/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
#
66
# See https://swift.org/LICENSE.txt for license information
77

8-
cmake_minimum_required(VERSION 3.22)
9-
10-
if(POLICY CMP0157)
11-
cmake_policy(SET CMP0157 NEW)
12-
endif()
8+
cmake_minimum_required(VERSION 3.22...3.29)
139

1410
project(StringifyMacroExample
1511
LANGUAGES Swift)

4_swift_macros/StringifyMacro/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
#
66
# See https://swift.org/LICENSE.txt for license information
77

8-
cmake_minimum_required(VERSION 3.22)
9-
if(POLICY CMP0157)
10-
cmake_policy(SET CMP0157 NEW)
11-
endif()
8+
cmake_minimum_required(VERSION 3.22...3.29)
129

1310
project(StringifyMacro
1411
LANGUAGES Swift)

0 commit comments

Comments
 (0)