Skip to content

Commit 6e15796

Browse files
committed
WIP/Foundation: port to Windows
Unformalised changes to port Foundation to Windows
1 parent 4be63ae commit 6e15796

File tree

3 files changed

+523
-36
lines changed

3 files changed

+523
-36
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
110110
set(Foundation_rpath_flags -Xlinker;-rpath;-Xlinker;"\\\$\$ORIGIN")
111111
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
112112
set(deployment_target -DDEPLOYMENT_TARGET_WINDOWS)
113+
set(CoreFoundation_INTERFACE_LIBRARIES -lWS2_32 -lUser32 -lmsvcrt -ladvapi32 -lshell32 -lrpcrt4 -lsecur32 -lPathcch -lOle32 -lCrypt32 -lwldap32 -lNormaliz -lDbgHelp -lIphlpapi)
113114
endif()
114115

115116
add_swift_library(Foundation
@@ -298,13 +299,15 @@ add_swift_library(Foundation
298299
-L${CMAKE_CURRENT_BINARY_DIR}
299300
-luuid
300301
${Foundation_rpath_flags}
302+
${CoreFoundation_INTERFACE_LIBRARIES}
301303
SWIFT_FLAGS
302304
-DDEPLOYMENT_RUNTIME_SWIFT
303305
${deployment_enable_libdispatch}
304306
-I;${ICU_INCLUDE_DIR}
305307
${libdispatch_cflags}
306308
${swift_enable_testing}
307309
${swift_optimization_flags}
310+
-Xcc -D_DLL
308311
DEPENDS
309312
CoreFoundation)
310313

CoreFoundation/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,12 @@ if(CF_DEPLOYMENT_SWIFT)
353353
target_compile_definitions(CoreFoundation
354354
PRIVATE
355355
-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()
356362
else()
357363
target_compile_definitions(CoreFoundation
358364
PRIVATE

0 commit comments

Comments
 (0)