Skip to content

Commit 33ada8e

Browse files
committed
build: use C++14 for Windows builds
The Windows SDK headers require C++14 or newer features. Visual Studio is lax in enabling these features unlike clang. Explicitly upgrade to the higher standard for the Windows cross-compilation.
1 parent 251282a commit 33ada8e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,9 @@ function(_add_swift_library_single target name)
856856
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
857857
swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
858858
target_include_directories("${target}" SYSTEM PRIVATE ${SWIFTLIB_INCLUDE})
859+
set_target_properties(${target}
860+
PROPERTIES
861+
CXX_STANDARD 14)
859862
endif()
860863

861864
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")

0 commit comments

Comments
 (0)