Skip to content

Commit 63e21d1

Browse files
committed
build: enable cross-linking
1 parent 73726fa commit 63e21d1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/modules/SwiftSupport.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function(add_swift_target target)
1313

1414
if(AST_TARGET)
1515
list(APPEND compile_flags -target;${AST_TARGET})
16+
list(APPEND link_flags -target;${AST_TARGET})
1617
endif()
1718
if(AST_MODULE_NAME)
1819
list(APPEND compile_flags -module-name;${AST_MODULE_NAME})
@@ -25,6 +26,9 @@ function(add_swift_target target)
2526
if(AST_MODULE_CACHE_PATH)
2627
list(APPEND compile_flags -module-cache-path;${AST_MODULE_CACHE_PATH})
2728
endif()
29+
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
30+
list(APPEND compile_flags -g)
31+
endif()
2832
if(AST_SWIFT_FLAGS)
2933
foreach(flag ${AST_SWIFT_FLAGS})
3034
list(APPEND compile_flags ${flag})

0 commit comments

Comments
 (0)