@@ -802,26 +802,18 @@ function(_add_swift_target_library_single target name)
802
802
# Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
803
803
if (SWIFT_EMBED_BITCODE_SECTION AND NOT SWIFTLIB_SINGLE_DONT_EMBED_BITCODE )
804
804
if (${SWIFTLIB_SINGLE_SDK} MATCHES "(I|TV|WATCH)OS" )
805
- # The two branches of this if statement accomplish the same end result
806
- # We are simply accounting for the fact that on CMake < 3.16
807
- # using a generator expression to
808
- # specify a LINKER: argument does not work,
805
+ # Please note that using a generator expression to fit
806
+ # this in a single target_link_options does not work
807
+ # (at least in CMake 3.15 and 3.16),
809
808
# since that seems not to allow the LINKER: prefix to be
810
809
# evaluated (i.e. it will be added as-is to the linker parameters)
811
- if (CMAKE_VERSION VERSION_LESS 3.16 )
812
- target_link_options (${target} PRIVATE
813
- "LINKER:-bitcode_bundle"
814
- "LINKER:-lto_library,${LLVM_LIBRARY_DIR} /libLTO.dylib" )
810
+ target_link_options (${target} PRIVATE
811
+ "LINKER:-bitcode_bundle"
812
+ "LINKER:-lto_library,${LLVM_LIBRARY_DIR} /libLTO.dylib" )
815
813
816
- if (SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS )
817
- target_link_options (${target} PRIVATE
818
- "LINKER:-bitcode_hide_symbols" )
819
- endif ()
820
- else ()
814
+ if (SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS )
821
815
target_link_options (${target} PRIVATE
822
- "LINKER:-bitcode_bundle"
823
- $< $< BOOL:SWIFT_EMBED_BITCODE_SECTION_HIDE_SYMBOLS> :"LINKER:-bitcode_hide_symbols">
824
- "LINKER:-lto_library,${LLVM_LIBRARY_DIR} /libLTO.dylib" )
816
+ "LINKER:-bitcode_hide_symbols" )
825
817
endif ()
826
818
endif ()
827
819
endif ()
0 commit comments