Skip to content

Commit 3dc815b

Browse files
committed
Potential fix for --xcode build on M1.
1 parent 7534c06 commit 3dc815b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ 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 ${all_obj_files})
174+
add_library(${name} STATIC force_lib.c ${all_obj_files})
175175
add_dependencies(${name} ${all_module_targets})
176176
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)
177177
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})

SwiftCompilerSources/force_lib.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//===--- force_lib.c ------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
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.

0 commit comments

Comments
 (0)