Skip to content

Commit 846fdb5

Browse files
committed
[interop] add target-build-swift-link-cxx option for windows to link correctly
1 parent 1d3b682 commit 846fdb5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

test/Interop/SwiftToCxx/functions/cdecl-execution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend %S/cdecl.swift -typecheck -module-name CdeclFunctions -emit-cxx-header-path %t/functions.h
44

55
// RUN: %target-clangxx -c %s -I %t -o %t/cdecl-execution.o
6-
// RUN: %target-build-swift %S/cdecl.swift -o %t/cdecl-execution -Xlinker %t/cdecl-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain -Xfrontend -enable-cxx-interop
6+
// RUN: %target-build-swift-link-cxx %S/cdecl.swift -o %t/cdecl-execution -Xlinker %t/cdecl-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
77

88
// RUN: %target-codesign %t/cdecl-execution
99
// RUN: %target-run %t/cdecl-execution

test/Interop/SwiftToCxx/functions/swift-functions-execution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend %S/swift-functions.swift -typecheck -module-name Functions -emit-cxx-header-path %t/functions.h
44

55
// RUN: %target-clangxx -c %s -I %t -o %t/swift-functions-execution.o
6-
// RUN: %target-build-swift %S/swift-functions.swift -o %t/swift-functions-execution -Xlinker %t/swift-functions-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain -Xfrontend -enable-cxx-interop
6+
// RUN: %target-build-swift-link-cxx %S/swift-functions.swift -o %t/swift-functions-execution -Xlinker %t/swift-functions-execution.o -module-name Functions -Xfrontend -entry-point-function-name -Xfrontend swiftMain
77

88
// RUN: %target-codesign %t/swift-functions-execution
99
// RUN: %target-run %t/swift-functions-execution | %FileCheck %s

test/Interop/lit.local.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ def get_target_os():
66
(run_cpu, run_vendor, run_os, run_version) = re.match('([^-]+)-([^-]+)-([^0-9]+)(.*)', config.variant_triple).groups()
77
return run_os
88

9+
libc_opt = ''
910
if get_target_os() in ['windows-msvc']:
1011
config.substitutions.insert(0, ('%target-abi', 'WIN'))
12+
libc_opt = '-libc MT '
1113
else:
1214
# FIXME(compnerd) do all the targets we currently support use SysV ABI?
1315
config.substitutions.insert(0, ('%target-abi', 'SYSV'))
1416

17+
config.substitutions.insert(0, ('%target-build-swift-link-cxx', '%target-build-swift -Xfrontend -enable-cxx-interop ' + libc_opt))

0 commit comments

Comments
 (0)