Skip to content

Commit d63f42a

Browse files
committed
Attempt to restore some Windows build settings
1 parent 27ae565 commit d63f42a

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
128128
list(APPEND _Foundation_common_build_flags
129129
"-D_GNU_SOURCE"
130130
"-I/usr/lib/swift") # dispatch
131+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
132+
list(APPEND _Foundation_common_build_flags
133+
"-D_DLL"
134+
"-D_WINDLL")
131135
endif()
132136

133137
include(FoundationSwiftSupport)

Sources/CoreFoundation/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ target_link_libraries(CoreFoundation
115115
_FoundationICU
116116
dispatch)
117117

118+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
119+
target_link_libraries(CoreFoundation
120+
PRIVATE
121+
AdvAPI32
122+
Secur32
123+
User32
124+
mincore
125+
pathcch)
126+
endif()
127+
118128
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS CoreFoundation)
119129

120130
# Copy Headers to known directory for direct client (XCTest) test builds

Sources/_CFURLSessionInterface/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ target_link_libraries(_CFURLSessionInterface PRIVATE
3030
dispatch
3131
CURL::libcurl)
3232

33+
34+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
35+
target_link_libraries(_CFURLSessionInterface
36+
PRIVATE
37+
AdvAPI32
38+
Secur32
39+
User32
40+
mincore)
41+
endif()
42+
3343
if(NOT BUILD_SHARED_LIBS)
3444
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFURLSessionInterface)
3545
install(TARGETS _CFURLSessionInterface

Sources/_CFXMLInterface/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ target_link_libraries(_CFXMLInterface PRIVATE
2929
dispatch
3030
LibXml2::LibXml2)
3131

32+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
33+
target_link_libraries(_CFXMLInterface
34+
PRIVATE
35+
AdvAPI32
36+
Secur32
37+
User32
38+
mincore)
39+
endif()
40+
3241
if(NOT BUILD_SHARED_LIBS)
3342
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS _CFXMLInterface)
3443
install(TARGETS _CFXMLInterface

0 commit comments

Comments
 (0)