mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[interop] add target-build-swift-link-cxx option for windows to link correctly
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// RUN: %target-swift-frontend %S/cdecl.swift -typecheck -module-name CdeclFunctions -emit-cxx-header-path %t/functions.h
|
||||
|
||||
// RUN: %target-clangxx -c %s -I %t -o %t/cdecl-execution.o
|
||||
// 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
|
||||
// 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
|
||||
|
||||
// RUN: %target-codesign %t/cdecl-execution
|
||||
// RUN: %target-run %t/cdecl-execution
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// RUN: %target-swift-frontend %S/swift-functions.swift -typecheck -module-name Functions -emit-cxx-header-path %t/functions.h
|
||||
|
||||
// RUN: %target-clangxx -c %s -I %t -o %t/swift-functions-execution.o
|
||||
// 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
|
||||
// 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
|
||||
|
||||
// RUN: %target-codesign %t/swift-functions-execution
|
||||
// RUN: %target-run %t/swift-functions-execution | %FileCheck %s
|
||||
|
||||
@@ -6,9 +6,12 @@ def get_target_os():
|
||||
(run_cpu, run_vendor, run_os, run_version) = re.match('([^-]+)-([^-]+)-([^0-9]+)(.*)', config.variant_triple).groups()
|
||||
return run_os
|
||||
|
||||
libc_opt = ''
|
||||
if get_target_os() in ['windows-msvc']:
|
||||
config.substitutions.insert(0, ('%target-abi', 'WIN'))
|
||||
libc_opt = '-libc MT '
|
||||
else:
|
||||
# FIXME(compnerd) do all the targets we currently support use SysV ABI?
|
||||
config.substitutions.insert(0, ('%target-abi', 'SYSV'))
|
||||
|
||||
config.substitutions.insert(0, ('%target-build-swift-link-cxx', '%target-build-swift -Xfrontend -enable-cxx-interop ' + libc_opt))
|
||||
|
||||
Reference in New Issue
Block a user