build: enable cross-linking
@@ -13,6 +13,7 @@ function(add_swift_target target)
if(AST_TARGET)
list(APPEND compile_flags -target;${AST_TARGET})
+ list(APPEND link_flags -target;${AST_TARGET})
endif()
if(AST_MODULE_NAME)
list(APPEND compile_flags -module-name;${AST_MODULE_NAME})
@@ -25,6 +26,9 @@ function(add_swift_target target)
if(AST_MODULE_CACHE_PATH)
list(APPEND compile_flags -module-cache-path;${AST_MODULE_CACHE_PATH})
endif()
+ if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
+ list(APPEND compile_flags -g)
+ endif()
if(AST_SWIFT_FLAGS)
foreach(flag ${AST_SWIFT_FLAGS})
list(APPEND compile_flags ${flag})
