File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
stdlib/public/SwiftShims/swift/shims Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -33,5 +33,8 @@ add_library(swiftShims INTERFACE)
33
33
target_include_directories (swiftShims INTERFACE
34
34
$< $< COMPILE_LANGUAGE:C,CXX> :${CMAKE_CURRENT_SOURCE_DIR} /../../>
35
35
$< $< COMPILE_LANGUAGE:Swift> :${CMAKE_CURRENT_SOURCE_DIR} > )
36
+ target_compile_definitions (swiftShims INTERFACE
37
+ $< $< AND:$< NOT:$< BOOL:${BUILD_SHARED_LIBS} > > ,$< COMPILE_LANGUAGE:C,CXX> > :SWIFT_STATIC_STDLIB> )
36
38
target_compile_options (swiftShims INTERFACE
39
+ "$<$<AND:$<NOT:$<BOOL:${BUILD_SHARED_LIBS} >>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xcc -DSWIFT_STATIC_STDLIB>"
37
40
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR} /module.modulemap>" )
Original file line number Diff line number Diff line change @@ -152,6 +152,8 @@ if("${SwiftCore_OBJECT_FORMAT}" STREQUAL "elfx")
152
152
install (TARGETS swiftrt DESTINATION "${CMAKE_INSTALL_LIBDIR} /swift" )
153
153
elseif ("${SwiftCore_OBJECT_FORMAT} " STREQUAL "coffx" )
154
154
add_library (swiftrt OBJECT SwiftRT-COFF.cpp )
155
+ target_compile_definitions (swiftrt PRIVATE
156
+ $< $< NOT:$< BOOL:${BUILD_SHARED_LIBS} > > :SWIFT_STATIC_STDLIB> )
155
157
target_link_libraries (swiftrt PRIVATE swiftShims )
156
158
install (TARGETS swiftrt DESTINATION "${CMAKE_INSTALL_LIBDIR} /swift" )
157
159
elseif (NOT "${SwiftCore_OBJECT_FORMAT} " STREQUAL "x" )
Original file line number Diff line number Diff line change 168
168
// FIXME: this #else should be some sort of #elif Windows
169
169
#else // !__MACH__ && !__ELF__
170
170
171
- // On PE/COFF, we use dllimport and dllexport.
172
- # define SWIFT_ATTRIBUTE_FOR_EXPORTS __declspec (dllexport)
173
- # define SWIFT_ATTRIBUTE_FOR_IMPORTS __declspec (dllimport)
171
+ # if defined(SWIFT_STATIC_STDLIB)
172
+ # define SWIFT_ATTRIBUTE_FOR_EXPORTS /* */
173
+ # define SWIFT_ATTRIBUTE_FOR_IMPORTS /* */
174
+ # else
175
+ # define SWIFT_ATTRIBUTE_FOR_EXPORTS __declspec (dllexport)
176
+ # define SWIFT_ATTRIBUTE_FOR_IMPORTS __declspec (dllimport)
177
+ # endif
174
178
175
179
#endif
176
180
You can’t perform that action at this time.
0 commit comments