From d38bd10332e6ea03b0237f8a3ca4238b267bbcf8 Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 23 Mar 2023 09:19:17 -0700 Subject: [PATCH] [SwiftSyntax] Add CMake argument to enable assertions in SwiftSyntax for Release+Assert builds This does not do anything by itself, it needs a corresponding change in swift-syntax to pick up the CMake option and actually enable assertions. --- .../swift_build_support/products/earlyswiftsyntax.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/swift_build_support/swift_build_support/products/earlyswiftsyntax.py b/utils/swift_build_support/swift_build_support/products/earlyswiftsyntax.py index 4bcce9e09bbb9..485be3c1a497d 100644 --- a/utils/swift_build_support/swift_build_support/products/earlyswiftsyntax.py +++ b/utils/swift_build_support/swift_build_support/products/earlyswiftsyntax.py @@ -54,6 +54,8 @@ def build(self, host_target): self.generate_toolchain_file_for_darwin_or_linux(host_target) self.cmake_options.define('CMAKE_INSTALL_PREFIX:PATH', self.args.install_prefix) + self.cmake_options.define('SWIFTSYNTAX_ENABLE_ASSERTIONS:BOOL', + self.args.assertions) self.build_with_cmake(["all"], self.args.swift_build_variant, []) def should_test(self, host_target):