Skip to content

Commit 51ab7d6

Browse files
committed
Merge pull request #2816 from apple/cmake-fix-unoptimized-stdlib-builds
CMake: fix non-optimized standard library builds
2 parents 6328f3f + 2b001bb commit 51ab7d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ function(add_swift_library name)
10311031

10321032
# All Swift code depends on the standard library, except for the standard
10331033
# library itself.
1034-
if(SWIFTLIB_TARGET_LIBRARY AND SWIFTLIB_HAS_SWIFT_CONTENT AND NOT SWIFTLIB_IS_STDLIB_CORE)
1034+
if(SWIFTLIB_HAS_SWIFT_CONTENT AND NOT SWIFTLIB_IS_STDLIB_CORE)
10351035
list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS Core)
10361036
endif()
10371037

@@ -1041,11 +1041,11 @@ function(add_swift_library name)
10411041
Core)
10421042
endif()
10431043

1044-
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" optimized)
1045-
if(NOT optimized)
1044+
if(SWIFTLIB_HAS_SWIFT_CONTENT AND NOT SWIFTLIB_IS_STDLIB_CORE)
10461045
# All Swift code depends on the SwiftOnoneSupport in non-optimized mode,
10471046
# except for the standard library itself.
1048-
if(SWIFTLIB_TARGET_LIBRARY AND NOT SWIFTLIB_IS_STDLIB_CORE)
1047+
is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" optimized)
1048+
if(NOT optimized)
10491049
list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS SwiftOnoneSupport)
10501050
endif()
10511051
endif()

0 commit comments

Comments
 (0)