Skip to content

Commit 7ef2877

Browse files
authored
Add -no-verify-emitted-module-interface (#2)
1 parent 03fd11f commit 7ef2877

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ let libraryEvolutionCondition = envEnable("OPENBOX_LIBRARY_EVOLUTION")
5151
#endif
5252

5353
if libraryEvolutionCondition {
54-
// NOTE: -enable-library-evolution is not supported on `swift build` yet.
55-
sharedSwiftSettings.append(.unsafeFlags(["-enable-library-evolution"]))
54+
// NOTE: -enable-library-evolution will cause module verify failure for `swift build`.
55+
// Either set OPENGRAPH_LIBRARY_EVOLUTION=0 or add `-Xswiftc -no-verify-emitted-module-interface` after `swift build`
56+
sharedSwiftSettings.append(.unsafeFlags(["-enable-library-evolution", "-no-verify-emitted-module-interface"]))
5657
}
5758

5859
// MARK: - Targets

Scripts/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ OPENBOX_ROOT="$(dirname $(dirname $(filepath $0)))"
99

1010
cd $OPENBOX_ROOT
1111

12-
OPENBOX_LIBRARY_EVOLUTION=0 swift build
12+
swift build

Scripts/build_swiftinterface.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/zsh
2+
3+
# A `realpath` alternative using the default C implementation.
4+
filepath() {
5+
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
6+
}
7+
8+
OPENBOX_ROOT="$(dirname $(dirname $(filepath $0)))"
9+
10+
cd $OPENBOX_ROOT
11+
12+
swift build -Xswiftc -emit-module-interface -Xswiftc -enable-library-evolution -Xswiftc -no-verify-emitted-module-interface

0 commit comments

Comments
 (0)