Skip to content

Commit 2b300eb

Browse files
authored
Merge pull request #2349 from gmittert/MyVersionOfEvents
[CMake] Manually Set swift-version
2 parents 3485604 + 56b3a9f commit 2b300eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ cmake_minimum_required(VERSION 3.15.1)
1111
project(SwiftPM LANGUAGES C Swift)
1212

1313
set(CMAKE_Swift_LANGUAGE_VERSION 4.2)
14+
if(CMAKE_VERSION VERSION_LESS 3.16)
15+
add_compile_options($<$<COMPILE_LANGUAGE:Swift>:-swift-version$<SEMICOLON>4.2>)
16+
endif()
17+
1418
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
1519

1620
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

0 commit comments

Comments
 (0)