File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,14 @@ function(add_swift_compiler_modules_library name)
171171 endforeach ()
172172
173173 # Create a static library containing all module object files.
174- add_library (${name} STATIC force_lib.c ${all_obj_files} )
174+ if (XCODE)
175+ # Xcode does not compile libraries that contain only object files.
176+ # Therefore, it fails to create the static library. As a workaround,
177+ # we add an empty source file force_lib.c to the target.
178+ add_library (${name} STATIC force_lib.c ${all_obj_files} )
179+ else ()
180+ add_library (${name} STATIC ${all_obj_files} )
181+ endif ()
175182 add_dependencies (${name} ${all_module_targets} )
176183 set_target_properties (${name} PROPERTIES LINKER_LANGUAGE CXX)
177184 set_property (GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name} )
Original file line number Diff line number Diff line change 1010//
1111//===----------------------------------------------------------------------===//
1212
13- /// Dummy source file to force CMake generated SwiftInTheCompiler.xcodeproj to sucessfully build static
14- /// libraries containing only object fies for "bootstrap" process building Swift sources into compiler.
13+ /// Dummy source file to force CMake generated SwiftInTheCompiler.xcodeproj
14+ /// to sucessfully build static libraries conatining only object files used
15+ /// during "bootstrap" process to link Swift sources into the compiler.
You can’t perform that action at this time.
0 commit comments