Skip to content

Commit 3b82dc0

Browse files
committed
[gardening] align platform checks when enabling bitcode inclusion
* use quoted arguments when referencing "SWIFTLIB_SINGLE_SDK" * break the first condition on multiple lines This will make changes to these conditions easier to review.
1 parent 35c5968 commit 3b82dc0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,9 @@ function(add_swift_target_library_single target name)
750750
# Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
751751
set(embed_bitcode_arg)
752752
if(SWIFT_EMBED_BITCODE_SECTION AND NOT SWIFTLIB_SINGLE_DONT_EMBED_BITCODE)
753-
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "IOS" OR "${SWIFTLIB_SINGLE_SDK}" STREQUAL "TVOS" OR "${SWIFTLIB_SINGLE_SDK}" STREQUAL "WATCHOS")
753+
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "IOS" OR
754+
"${SWIFTLIB_SINGLE_SDK}" STREQUAL "TVOS" OR
755+
"${SWIFTLIB_SINGLE_SDK}" STREQUAL "WATCHOS")
754756
list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS "-fembed-bitcode")
755757
set(embed_bitcode_arg EMBED_BITCODE)
756758
endif()
@@ -1318,9 +1320,9 @@ function(add_swift_target_library_single target name)
13181320
endif()
13191321
# Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
13201322
if(SWIFT_EMBED_BITCODE_SECTION AND NOT SWIFTLIB_SINGLE_DONT_EMBED_BITCODE)
1321-
if(${SWIFTLIB_SINGLE_SDK} STREQUAL "IOS" OR
1322-
${SWIFTLIB_SINGLE_SDK} STREQUAL "TVOS" OR
1323-
${SWIFTLIB_SINGLE_SDK} STREQUAL "WATCHOS")
1323+
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "IOS" OR
1324+
"${SWIFTLIB_SINGLE_SDK}" STREQUAL "TVOS" OR
1325+
"${SWIFTLIB_SINGLE_SDK}" STREQUAL "WATCHOS")
13241326
# Please note that using a generator expression to fit
13251327
# this in a single target_link_options does not work
13261328
# (at least in CMake 3.15 and 3.16),

0 commit comments

Comments
 (0)