Skip to content

Commit a8ff674

Browse files
committed
build: inline -O flag
1 parent 3aa1ffb commit a8ff674

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
7575
endif()
7676
add_dependencies(uuid CoreFoundation)
7777

78-
set(swift_optimization_flags)
79-
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
80-
set(swift_optimization_flags -O)
81-
endif()
8278
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
8379
set(swift_libc_flags -libc;${CMAKE_MSVC_RUNTIME_LIBRARY})
8480
if(CMAKE_SYSTEM_NAME STREQUAL Debug)
@@ -294,7 +290,7 @@ add_swift_library(Foundation
294290
-I;${ICU_INCLUDE_DIR}
295291
${libdispatch_cflags}
296292
$<$<BOOL:ENABLE_TESTING>:-enable-testing>
297-
${swift_optimization_flags}
293+
$<$<NOT:$<CONFIG:Debug>>:-O>
298294
${swift_libc_flags}
299295
DEPENDS
300296
uuid
@@ -399,7 +395,7 @@ add_swift_executable(plutil
399395
-I;${ICU_INCLUDE_DIR}
400396
${libdispatch_cflags}
401397
$<$<BOOL:ENABLE_TESTING>:-enable-testing>
402-
${swift_optimization_flags}
398+
$<$<NOT:$<CONFIG:Debug>>:-O>
403399
${swift_libc_flags}
404400
DEPENDS
405401
uuid
@@ -568,7 +564,7 @@ if(ENABLE_TESTING)
568564
-I;${FOUNDATION_PATH_TO_XCTEST_BUILD}/swift
569565
-I;${ICU_INCLUDE_DIR}
570566
${libdispatch_cflags}
571-
${swift_optimization_flags}
567+
$<$<NOT:$<CONFIG:Debug>>:-O>
572568
${swift_libc_flags}
573569
DEPENDS
574570
Foundation

0 commit comments

Comments
 (0)