summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeSwiftInformation.cmake
diff options
context:
space:
mode:
authorDavid Geldreich <david.geldreich@free.fr>2022-08-04 12:51:22 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-04 13:45:31 (GMT)
commit20fe9cf7e995880376fbf02207e63762b74890a8 (patch)
treec072804d7f049bf74d39051d36722755e519541d /Modules/CMakeSwiftInformation.cmake
parent365613d98b86ffadfa7137eeb6754dc3ac1443bb (diff)
downloadCMake-20fe9cf7e995880376fbf02207e63762b74890a8.zip
CMake-20fe9cf7e995880376fbf02207e63762b74890a8.tar.gz
CMake-20fe9cf7e995880376fbf02207e63762b74890a8.tar.bz2
Swift: Disable optimization when compiling in Debug
By default no `-O...` flag is specified for Debug configuration for Swift so Xcode adds a (wrong) `-O` flag that prevents one from accessing variables while debugging. Add `-Onone` to the Swift Debug configuration to avoid this. Fixes: #23818
Diffstat (limited to 'Modules/CMakeSwiftInformation.cmake')
-rw-r--r--Modules/CMakeSwiftInformation.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index ecad1d5..16726d2 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -65,7 +65,7 @@ set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -libc MD)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -libc MTd)
set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -libc MDd)
-set(CMAKE_Swift_FLAGS_DEBUG_INIT "-g")
+set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g")
set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")