mirror of
https://github.com/apple/swift-asn1
synced 2026-11-22 04:10:39 +00:00
[CMake] Enable CMP0157 and keep whole-module builds for optimized configs (#139)
Enable CMP0157 so Ninja compiles each Swift module in its own step, separate from the link. Optimized configurations keep `-wmo`, as under the old policy. Tracking: swiftlang/swift#93995 assisted by Claude
This commit is contained in:
1 parent
917b472dbe
commit
12b0abc194
1 file changed
+8
@@ -14,9 +14,17 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.19)
|
||||
|
||||
if(POLICY CMP0157)
|
||||
cmake_policy(SET CMP0157 NEW)
|
||||
endif()
|
||||
|
||||
project(SwiftASN1
|
||||
LANGUAGES Swift)
|
||||
|
||||
if(POLICY CMP0157 AND PROJECT_IS_TOP_LEVEL)
|
||||
set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release,RelWithDebInfo,MinSizeRel>,wholemodule,incremental>")
|
||||
endif()
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
|
||||
|
||||
include(SwiftSupport)
|
||||
|
||||
Reference in new issue
Block a user