Skip to content

Commit f60ab4a

Browse files
committed
Use target_link_libraries not add_library
add_library verifies that the target exists, so if swift isn't being built, or hasn't been configured yet, CMake complains. target_link_libraries doesn't care about the target at configure time. If the library doesn't exist come link-time, then we will see an error.
1 parent 1086999 commit f60ab4a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lldb/source/Plugins/ExpressionParser/Swift/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ if(NOT LLDB_BUILT_STANDALONE)
22
set(tablegen_deps intrinsics_gen)
33
endif()
44

5-
if (NOT BOOTSTRAPPING_MODE)
6-
add_library(swiftCompilerModules ALIAS swiftCompilerStub)
7-
endif()
8-
95
add_lldb_library(lldbPluginExpressionParserSwift PLUGIN
106
SwiftASTManipulator.cpp
117
SwiftExpressionParser.cpp
@@ -41,7 +37,6 @@ add_lldb_library(lldbPluginExpressionParserSwift PLUGIN
4137
swiftSIL
4238
swiftSILOptimizer
4339
swiftSerialization
44-
swiftCompilerModules
4540
clangAST
4641
clangBasic
4742
clangRewrite
@@ -50,3 +45,13 @@ add_lldb_library(lldbPluginExpressionParserSwift PLUGIN
5045
Support
5146
Core
5247
)
48+
49+
if(BOOTSTRAPPING_MODE)
50+
target_link_libraries(lldbPluginExpressionParserSwift
51+
PRIVATE
52+
swiftCompilerModules)
53+
else()
54+
target_link_libraries(lldbPluginExpressionParserSwift
55+
PRIVATE
56+
swiftCompilerStub)
57+
endif()

0 commit comments

Comments
 (0)