Skip to content

Commit b4d0fc2

Browse files
committed
Resolve unit test link error due to a build cycle
We currently hit the following errors when attempting to link unit tests: ``` Undefined symbols for architecture arm64: "swift::ConstExprEvaluator::ConstExprEvaluator(swift::SymbolicValueAllocator&, unsigned int, bool)", referenced from: BridgedConstExprFunctionState::create() in libswiftSIL.a[63](SILBridging.cpp.o) "swift::ConstExprEvaluator::~ConstExprEvaluator()", referenced from: BridgedConstExprFunctionState::deinitialize() in libswiftSIL.a[63](SILBridging.cpp.o) "swift::ConstExprFunctionState::getConstantValue(swift::SILValue)", referenced from: BridgedConstExprFunctionState::isConstantValue(BridgedValue) in libswiftSIL.a[63](SILBridging.cpp.o) "swift::ConstExprFunctionState::ConstExprFunctionState(swift::ConstExprEvaluator&, swift::SILFunction*, swift::SubstitutionMap, unsigned int&, bool)", referenced from: BridgedConstExprFunctionState::create() in libswiftSIL.a[63](SILBridging.cpp.o) ``` There is an implicit cyclic dependency here between `libswiftSIL` and `libswiftSILOptimizer`, which is okay to have at link time as long as these are static archives and as long as respective archives are specified explicitly on the linker invocation. This change achives that. Resolves rdar://150944677
1 parent 47e5ede commit b4d0fc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SIL/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ target_link_libraries(swiftSIL PRIVATE
66
swiftAST
77
swiftClangImporter
88
swiftSema
9-
swiftSerialization)
9+
swiftSerialization
10+
swiftSILOptimizer)
1011

1112
add_subdirectory(IR)
1213
add_subdirectory(Utils)

0 commit comments

Comments
 (0)