File tree Expand file tree Collapse file tree 6 files changed +610
-42
lines changed Expand file tree Collapse file tree 6 files changed +610
-42
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
110
110
set (Foundation_rpath_flags -Xlinker;-rpath;-Xlinker; "\\\$\$ ORIGIN" )
111
111
elseif (CMAKE_SYSTEM_NAME STREQUAL Windows )
112
112
set (deployment_target -DDEPLOYMENT_TARGET_WINDOWS )
113
+ set (CoreFoundation_INTERFACE_LIBRARIES -lWS2_32 -lUser32 -lmsvcrt -ladvapi32 -lshell32 -lrpcrt4 -lsecur32 -lPathcch -lOle32 -lCrypt32 -lwldap32 -lNormaliz )
113
114
endif ()
114
115
115
116
add_swift_library (Foundation
@@ -297,13 +298,15 @@ add_swift_library(Foundation
297
298
-L${CMAKE_CURRENT_BINARY_DIR}
298
299
-luuid
299
300
${Foundation_rpath_flags}
301
+ ${CoreFoundation_INTERFACE_LIBRARIES}
300
302
SWIFT_FLAGS
301
303
-DDEPLOYMENT_RUNTIME_SWIFT
302
304
${deployment_enable_libdispatch}
303
305
-I;${ICU_INCLUDE_DIR}
304
306
${libdispatch_cflags}
305
307
${swift_enable_testing}
306
308
${swift_optimization_flags}
309
+ -Xcc -D_DLL
307
310
DEPENDS
308
311
CoreFoundation )
309
312
Original file line number Diff line number Diff line change @@ -353,6 +353,12 @@ if(CF_DEPLOYMENT_SWIFT)
353
353
target_compile_definitions (CoreFoundation
354
354
PRIVATE
355
355
-DDEPLOYMENT_RUNTIME_SWIFT )
356
+ if (CMAKE_SYSTEM_NAME STREQUAL Windows )
357
+ target_compile_definitions (CoreFoundation
358
+ PRIVATE
359
+ -D_DLL
360
+ -DCURL_STATICLIB )
361
+ endif ()
356
362
else ()
357
363
target_compile_definitions (CoreFoundation
358
364
PRIVATE
Original file line number Diff line number Diff line change 12
12
13
13
#if DEPLOYMENT_RUNTIME_SWIFT
14
14
15
- #if os(Linux)
15
+ #if os(Linux) || os(Windows)
16
16
@inlinable // This is @inlinable as trivially computable.
17
17
internal func malloc_good_size( _ size: Int ) -> Int {
18
18
return size
@@ -22,7 +22,11 @@ internal func malloc_good_size(_ size: Int) -> Int {
22
22
import CoreFoundation
23
23
24
24
internal func __NSDataInvokeDeallocatorUnmap( _ mem: UnsafeMutableRawPointer , _ length: Int ) {
25
+ #if os(Windows)
26
+ UnmapViewOfFile ( mem)
27
+ #else
25
28
munmap ( mem, length)
29
+ #endif
26
30
}
27
31
28
32
internal func __NSDataInvokeDeallocatorFree( _ mem: UnsafeMutableRawPointer , _ length: Int ) {
You can’t perform that action at this time.
0 commit comments