Skip to content

Commit 3df60b4

Browse files
committed
SwiftRemoteMirror: fix static library builds for Windows
We were previously treating all the builds as shared, which is not the case for the host library build of SwiftRemoteMirror. The warnings were lost in the interminable spew from the build which is now fixed and this stands out.
1 parent f820c6e commit 3df60b4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

include/swift/SwiftRemoteMirror/Platform.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,23 @@ extern "C" {
2323
# elif defined(__MACH__)
2424
# define SWIFT_REMOTE_MIRROR_LINKAGE __attribute__((__visibility__("default")))
2525
# else
26-
# define SWIFT_REMOTE_MIRROR_LINKAGE __declspec(dllexport)
26+
# if defined(_WINDLL)
27+
# define SWIFT_REMOTE_MIRROR_LINKAGE __declspec(dllexport)
28+
# else
29+
# define SWIFT_REMOTE_MIRROR_LINKAGE
30+
# endif
2731
# endif
2832
#else
2933
# if defined(__ELF__)
3034
# define SWIFT_REMOTE_MIRROR_LINKAGE __attribute__((__visibility__("default")))
3135
# elif defined(__MACH__)
3236
# define SWIFT_REMOTE_MIRROR_LINKAGE __attribute__((__visibility__("default")))
3337
# else
34-
# define SWIFT_REMOTE_MIRROR_LINKAGE __declspec(dllimport)
38+
# if defined(_WINDLL)
39+
# define SWIFT_REMOTE_MIRROR_LINKAGE __declspec(dllimport)
40+
# else
41+
# define SWIFT_REMOTE_MIRROR_LINKAGE
42+
# endif
3543
# endif
3644
#endif
3745

stdlib/public/SwiftRemoteMirror/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if(SWIFT_INCLUDE_TOOLS)
3030

3131
add_swift_host_library(swiftRemoteMirror STATIC
3232
SwiftRemoteMirror.cpp)
33+
target_compile_definitions(swiftRemoteMirror PRIVATE _LIB)
3334
target_compile_options(swiftRemoteMirror PRIVATE
3435
${SWIFT_RUNTIME_CXX_FLAGS})
3536
set_property(TARGET swiftRemoteMirror APPEND_STRING PROPERTY LINK_FLAGS

0 commit comments

Comments
 (0)