From b5c1c3000bbec97a45e646d75ce9354a0e22726c Mon Sep 17 00:00:00 2001 From: Ryan Mansfield Date: Tue, 2 Jul 2024 17:10:28 -0400 Subject: [PATCH] Specify -DCMAKE_BUILD_TYPE based on configuration option. --- Utilities/build-script-helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Utilities/build-script-helper.py b/Utilities/build-script-helper.py index 2c6f804ef..42921d6c5 100755 --- a/Utilities/build-script-helper.py +++ b/Utilities/build-script-helper.py @@ -540,10 +540,13 @@ def cmake_build(args, swiftc_exec, cmake_args, swift_flags, source_path, """Configure with CMake and build with Ninja""" if args.sysroot: swift_flags.append('-sdk %s' % args.sysroot) + + cmake_build_type = 'Debug' if args.configuration == 'debug' else 'Release' + cmd = [ args.cmake_bin, '-G', 'Ninja', '-DCMAKE_MAKE_PROGRAM=%s' % args.ninja_bin, - '-DCMAKE_BUILD_TYPE:=Release', + '-DCMAKE_BUILD_TYPE:=%s' % cmake_build_type, '-DCMAKE_Swift_FLAGS=' + ' '.join(swift_flags), '-DCMAKE_Swift_COMPILER:=%s' % (swiftc_exec), ] + cmake_args + [source_path]