Skip to content

[stdlib] Fixed for Cygwin #3886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ function(_add_swift_library_single target name)
elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "CYGWIN")
set_target_properties("${target}"
PROPERTIES
INSTALL_RPATH "$ORIGIN:/usr/lib/swift/windows")
INSTALL_RPATH "$ORIGIN:/usr/lib/swift/cygwin")
endif()

set_target_properties("${target}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
Expand Down Expand Up @@ -1256,6 +1256,9 @@ endfunction()
# SWIFT_MODULE_DEPENDS_LINUX
# Swift modules this library depends on when built for Linux.
#
# SWIFT_MODULE_DEPENDS_CYGWIN
# Swift modules this library depends on when built for Cygwin.
#
# FRAMEWORK_DEPENDS
# System frameworks this library depends on.
#
Expand Down Expand Up @@ -1329,7 +1332,7 @@ function(add_swift_library name)
cmake_parse_arguments(SWIFTLIB
"${SWIFTLIB_options}"
"INSTALL_IN_COMPONENT;DEPLOYMENT_VERSION_OSX;DEPLOYMENT_VERSION_IOS;DEPLOYMENT_VERSION_TVOS;DEPLOYMENT_VERSION_WATCHOS"
"DEPENDS;LINK_LIBRARIES;SWIFT_MODULE_DEPENDS;SWIFT_MODULE_DEPENDS_OSX;SWIFT_MODULE_DEPENDS_IOS;SWIFT_MODULE_DEPENDS_TVOS;SWIFT_MODULE_DEPENDS_WATCHOS;SWIFT_MODULE_DEPENDS_FREEBSD;SWIFT_MODULE_DEPENDS_LINUX;FRAMEWORK_DEPENDS;FRAMEWORK_DEPENDS_WEAK;FRAMEWORK_DEPENDS_OSX;FRAMEWORK_DEPENDS_IOS_TVOS;LLVM_COMPONENT_DEPENDS;FILE_DEPENDS;TARGET_SDKS;C_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS_OSX;SWIFT_COMPILE_FLAGS_IOS;SWIFT_COMPILE_FLAGS_TVOS;SWIFT_COMPILE_FLAGS_WATCHOS;LINK_FLAGS;PRIVATE_LINK_LIBRARIES;INTERFACE_LINK_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY"
"DEPENDS;LINK_LIBRARIES;SWIFT_MODULE_DEPENDS;SWIFT_MODULE_DEPENDS_OSX;SWIFT_MODULE_DEPENDS_IOS;SWIFT_MODULE_DEPENDS_TVOS;SWIFT_MODULE_DEPENDS_WATCHOS;SWIFT_MODULE_DEPENDS_FREEBSD;SWIFT_MODULE_DEPENDS_LINUX;SWIFT_MODULE_DEPENDS_CYGWIN;FRAMEWORK_DEPENDS;FRAMEWORK_DEPENDS_WEAK;FRAMEWORK_DEPENDS_OSX;FRAMEWORK_DEPENDS_IOS_TVOS;LLVM_COMPONENT_DEPENDS;FILE_DEPENDS;TARGET_SDKS;C_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS_OSX;SWIFT_COMPILE_FLAGS_IOS;SWIFT_COMPILE_FLAGS_TVOS;SWIFT_COMPILE_FLAGS_WATCHOS;LINK_FLAGS;PRIVATE_LINK_LIBRARIES;INTERFACE_LINK_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY"
${ARGN})
set(SWIFTLIB_SOURCES ${SWIFTLIB_UNPARSED_ARGUMENTS})

Expand Down Expand Up @@ -1462,6 +1465,9 @@ function(add_swift_library name)
elseif("${sdk}" STREQUAL "LINUX" OR "${sdk}" STREQUAL "ANDROID")
list(APPEND swiftlib_module_depends_flattened
${SWIFTLIB_SWIFT_MODULE_DEPENDS_LINUX})
elseif("${sdk}" STREQUAL "CYGWIN")
list(APPEND swiftlib_module_depends_flattened
${SWIFTLIB_SWIFT_MODULE_DEPENDS_CYGWIN})
endif()

# Swift compiles depend on swift modules, while links depend on
Expand Down
1 change: 1 addition & 0 deletions stdlib/private/StdlibUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_swift_library(swiftStdlibUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STD
SWIFT_MODULE_DEPENDS_WATCHOS Darwin Foundation
SWIFT_MODULE_DEPENDS_LINUX Glibc
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags}
TARGET_SDKS ALL_POSIX_PLATFORMS
INSTALL_IN_COMPONENT stdlib-experimental)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibUnittest/RaceTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import SwiftPrivateLibcExtras
import SwiftPrivatePthreadExtras
#if os(OSX) || os(iOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
import Glibc
#endif

Expand Down
2 changes: 1 addition & 1 deletion stdlib/private/StdlibUnittest/StdlibCoreExtras.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SwiftPrivate
import SwiftPrivateLibcExtras
#if os(OSX) || os(iOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
import Glibc
#endif

Expand Down
40 changes: 39 additions & 1 deletion stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import SwiftPrivateLibcExtras

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
import Glibc
#endif

Expand Down Expand Up @@ -1429,6 +1429,8 @@ public enum OSVersion : CustomStringConvertible {
case freeBSD
case android
case ps4
case windowsCygnus
case windows

public var description: String {
switch self {
Expand All @@ -1454,6 +1456,10 @@ public enum OSVersion : CustomStringConvertible {
return "PS4"
case .android:
return "Android"
case .windowsCygnus:
return "Cygwin"
case .windows:
return "Windows"
}
}
}
Expand Down Expand Up @@ -1492,6 +1498,10 @@ func _getOSVersion() -> OSVersion {
return .ps4
#elseif os(Android)
return .android
#elseif os(Windows) && CYGWIN
return .windowsCygnus
#elseif os(Windows)
return .windows
#else
let productVersion = _stdlib_getSystemVersionPlistProperty("ProductVersion")!
let (major, minor, bugFix) = _parseDottedVersionTriple(productVersion)
Expand Down Expand Up @@ -1570,6 +1580,10 @@ public enum TestRunPredicate : CustomStringConvertible {

case androidAny(reason: String)

case windowsAny(reason: String)

case windowsCygnusAny(reason: String)

case objCRuntime(/*reason:*/ String)
case nativeRuntime(/*reason:*/ String)

Expand Down Expand Up @@ -1656,6 +1670,12 @@ public enum TestRunPredicate : CustomStringConvertible {
case .ps4Any(reason: let reason):
return "ps4Any(*, reason: \(reason))"

case .windowsAny(reason: let reason):
return "windowsAny(*, reason: \(reason))"

case .windowsCygnusAny(reason: let reason):
return "windowsCygnusAny(*, reason: \(reason))"

case .objCRuntime(let reason):
return "Objective-C runtime, reason: \(reason))"
case .nativeRuntime(let reason):
Expand Down Expand Up @@ -1921,6 +1941,24 @@ public enum TestRunPredicate : CustomStringConvertible {
return false
}

case .windowsAny:
switch _getRunningOSVersion() {
case .windowsCygnus:
return true
case .windows:
return true
default:
return false
}

case .windowsCygnusAny:
switch _getRunningOSVersion() {
case .windowsCygnus:
return true
default:
return false
}

case .objCRuntime:
#if _runtime(_ObjC)
return true
Expand Down
1 change: 1 addition & 0 deletions stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ add_swift_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES
SWIFT_MODULE_DEPENDS_WATCHOS Darwin
SWIFT_MODULE_DEPENDS_LINUX Glibc
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
INSTALL_IN_COMPONENT stdlib-experimental)
14 changes: 13 additions & 1 deletion stdlib/private/SwiftPrivateLibcExtras/Subprocess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import SwiftPrivate
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
import Glibc
#endif

Expand Down Expand Up @@ -264,9 +264,19 @@ public enum ProcessTerminationStatus : CustomStringConvertible {

public func posixWaitpid(_ pid: pid_t) -> ProcessTerminationStatus {
var status: CInt = 0
#if CYGWIN
withUnsafeMutablePointer(to: &status) {
statusPtr in
let statusPtrWrapper = __wait_status_ptr_t(__int_ptr: statusPtr)
if waitpid(pid, statusPtrWrapper, 0) < 0 {
preconditionFailure("waitpid() failed")
}
}
#else
if waitpid(pid, &status, 0) < 0 {
preconditionFailure("waitpid() failed")
}
#endif
if WIFEXITED(status) {
return .exit(Int(WEXITSTATUS(status)))
}
Expand All @@ -290,6 +300,8 @@ internal func _getEnviron() -> UnsafeMutablePointer<UnsafeMutablePointer<CChar>?
return environ
#elseif os(Android)
return environ
#elseif CYGWIN
return environ
#else
return __environ
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public func _stdlib_select(
let readAddr = readfds.baseAddress
let writeAddr = writefds.baseAddress
let errorAddr = errorfds.baseAddress
#if CYGWIN
typealias fd_set = _types_fd_set
#endif
func asFdSetPtr(
_ p: UnsafeMutablePointer<UInt>?
) -> UnsafeMutablePointer<fd_set>? {
Expand Down
1 change: 1 addition & 0 deletions stdlib/private/SwiftPrivatePthreadExtras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ add_swift_library(swiftSwiftPrivatePthreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TY
SWIFT_MODULE_DEPENDS_WATCHOS Darwin
SWIFT_MODULE_DEPENDS_LINUX Glibc
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
SWIFT_COMPILE_FLAGS ${STDLIB_SIL_SERIALIZE_ALL}
TARGET_SDKS ALL_POSIX_PLATFORMS
INSTALL_IN_COMPONENT stdlib-experimental)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
import Glibc
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
import Glibc
#endif

Expand Down
11 changes: 2 additions & 9 deletions stdlib/public/Platform/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public var SIG_HOLD: sighandler_t {
}
#elseif os(Windows)
#if CYGWIN
public typealias sighandler_t = __sighandler_t
public typealias sighandler_t = _sig_func_ptr

public var SIG_DFL: sighandler_t? { return nil }
public var SIG_IGN: sighandler_t {
Expand Down Expand Up @@ -417,16 +417,9 @@ public var SEM_FAILED: UnsafeMutablePointer<sem_t>? {
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
// The value is ABI. Value verified to be correct for OS X, iOS, watchOS, tvOS.
return UnsafeMutablePointer<sem_t>(bitPattern: -1)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
// The value is ABI. Value verified to be correct on Glibc.
return UnsafeMutablePointer<sem_t>(bitPattern: 0)
#elseif os(Windows)
#if CYGWIN
// The value is ABI. Value verified to be correct on Glibc.
return UnsafeMutablePointer<sem_t>(bitPattern: 0)
#else
_UnsupportedPlatformError()
#endif
#else
_UnsupportedPlatformError()
#endif
Expand Down
14 changes: 3 additions & 11 deletions stdlib/public/Platform/tgmath.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -215,22 +215,14 @@ public func fpclassify(_ value: ${T}) -> Int {
%if T == 'Double':
#if os(Linux)
return Int(__fpclassify(CDouble(value)))
#elseif os(Windows)
#if CYGWIN
return Int(__fpclassify(CDouble(value)))
#else
#elseif os(Windows) && !CYGWIN
return Int(_dclass(CDouble(value)))
#endif
#else
return Int(__fpclassifyd(CDouble(value)))
#endif
%else:
#if os(Windows)
#if CYGWIN
return Int(__fpclassify${f}(${CT}(value)))
#else
#if os(Windows) && !CYGWIN
return Int(_${f}dclass(${CT}(value)))
#endif
#else
return Int(__fpclassify${f}(${CT}(value)))
#endif
Expand Down Expand Up @@ -305,7 +297,7 @@ public func scalbn(_ x: ${T}, _ n: Int) -> ${T} {

% # This is AllFloatTypes not OverlayFloatTypes because of the tuple return.
% for T, CT, f in AllFloatTypes():
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || CYGWIN
@_transparent
public func lgamma(_ x: ${T}) -> (${T}, Int) {
var sign = Int32(0)
Expand Down
8 changes: 8 additions & 0 deletions stdlib/public/core/CTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ public typealias CShort = Int16
public typealias CInt = Int32

/// The C 'long' type.
#if os(Windows) && !CYGWIN && arch(x86_64)
public typealias CLong = Int32
#else
public typealias CLong = Int
#endif

/// The C 'long long' type.
#if os(Windows) && !CYGWIN && arch(x86_64)
public typealias CLongLong = Int
#else
public typealias CLongLong = Int64
#endif

/// The C 'float' type.
public typealias CFloat = Float
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/FloatingPoint.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ public protocol BinaryFloatingPoint: FloatingPoint, ExpressibleByFloatLiteral {
/// - Parameter value: A floating-point value.
init(_ value: Double)

#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))
/// Creates a new instance from the given value, rounded to the closest
/// possible representation.
///
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/FloatingPointParsing.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ internal func _isspace_clocale(_ u: UTF16.CodeUnit) -> Bool {
% Self = floatName(bits)

% if bits == 80:
#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))
% end

//===--- Parsing ----------------------------------------------------------===//
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/core/FloatingPointTypes.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ else:
}%

% if bits == 80:
#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))
% end

${SelfDocComment}
Expand Down Expand Up @@ -706,7 +706,7 @@ extension ${Self} : _ExpressibleByBuiltinIntegerLiteral, ExpressibleByIntegerLit
}
}

#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))

% builtinFloatLiteralBits = 80
extension ${Self} : _ExpressibleByBuiltinFloatLiteral {
Expand Down Expand Up @@ -851,7 +851,7 @@ extension ${Self} {
% That = src_type.stdlib_name

% if srcBits == 80:
#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))
% end

% if srcBits == bits:
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Policy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public typealias StringLiteralType = String
// IEEE Binary64, and we need 1 bit to represent the sign. Instead of using
// 1025, we use the next round number -- 2048.
public typealias _MaxBuiltinIntegerType = Builtin.Int2048
#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))
public typealias _MaxBuiltinFloatType = Builtin.FPIEEE80
#else
public typealias _MaxBuiltinFloatType = Builtin.FPIEEE64
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Runtime.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ internal struct _Buffer72 {
% for bits in [ 32, 64, 80 ]:

% if bits == 80:
#if !os(Windows) && (arch(i386) || arch(x86_64))
#if (!os(Windows) || CYGWIN) && (arch(i386) || arch(x86_64))
% end

@_silgen_name("swift_float${bits}ToString")
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/MutexWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//
//===----------------------------------------------------------------------===//

#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(_WIN32)
#include "swift/Runtime/Mutex.h"
#include "swift/Runtime/Debug.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// REQUIRES: executable_test

import StdlibUnittest
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android)
#if os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break on MSVC hosts?

Copy link
Contributor Author

@tinysun212 tinysun212 Aug 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested on windows-msvc. Only tested on Cygwin, and I believe it will be passed for MinGW.

Did you build an alternatives to Glibc for MSVC ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, msvcrt :-). Its a swift wrapper for ucrt and visualc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you change after this PR?
I think the code would be like this.

#if os(Windows) && MSVC
import Ucrt
import VisualC
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Windows)
import Glibc
#else
import Darwin
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@compnerd Could you share the build script (or manual) for MSVC ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I build on Linux. Just set INCLUDE and LIB as per Windows (adjust them for the movement from C:\ to whatever you're using) and add WINDOWS to the targets to build. I can give you my cmake/ninja invocation later when I'm near a computer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just do the following:

add -DSWIFT_SDKS="LINUX;WINDOWS" -DCMAKE_AR=$(which llvm-ar) -DCMAKE_RANLIB=$(which llvm-ranlib) -DSWIFT_WINDOWS_ICU_I18N_INCLUDE=${SWIFT_TOP_SRCDIR}/build/icu/source/i18n -DSWIFT_WINDOWS_ICU_UC_INCLUDE=${SWIFT_TOP_SRCDIR}/build/icu/source/common via --extra-cmake-options

You need to make sure that ld.lld is available to your toolchain, as building for Windows (MSVC) on !Windows will enable lld.

Additionally, I have the following environment variables setup:
INCLUDE='${SDK_TOP_SRCDIR}/Microsoft Visual Studio 14.0/VC/include;${SDK_TOP_SRCDIR}/Windows Kits/10/Include/10.0.10586.0/ucrt;${SDK_TOP_SRCDIR}/Windows Kits/10/Include/10.0.10586.0/um;${SDK_TOP_SRCDIR}/Windows Kits/10/Include/10.0.10586.0/shared'
LIB='${SDK_TOP_SRCDIR}/Microsoft Visual Studio 14.0/VC/lib;${SDK_TOP_SRCDIR}/Windows Kits/10/Lib/10.0.10586.0/ucrt/x86;${SDK_TOP_SRCDIR}/Windows Kits/10/Lib/10.0.10586.0/um/x86'

Within those paths which are directly lifted from a windows SDK installation, I have two symlinks constructed: ${SDK_TOP_SRCDIR}/Microsoft Visual Studio 14.0/VC/include/module.map -> ${SWIFT_TOP_SRCDIR}/swift/stdlib/public/Platform/visualc.modulemap
${SDK_TOP_SRCDIR}/Windows Kits/10/Include/10.0.10586.0/ucrt -> ${SWIFT_TOP_SRCDIR}/swift/stdlib/public/Platform/ucrt.modulemap

The import libraries for ICU are in the build directory as well. That tends to be sufficient to cross-compile from Linux x86_64 to Windows x86.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you.
Did you use the swift/clang compiler for Linux ?
I'll run those on my Linux machine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Ive been doing the entire build on Linux (and should be pretty trivial to reproduce on Darwin).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still breaks the non-cygwin case :/ You never addressed this!

import Glibc
#else
import Darwin
Expand Down
Loading