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)
3333target_include_directories (swiftShims INTERFACE
3434 $<$<COMPILE_LANGUAGE:C,CXX>:${CMAKE_CURRENT_SOURCE_DIR} /../../>
3535 $<$<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>)
3638target_compile_options (swiftShims INTERFACE
39+ "$<$<AND:$<NOT:$<BOOL:${BUILD_SHARED_LIBS} >>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xcc -DSWIFT_STATIC_STDLIB>"
3740 "$<$<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")
152152 install (TARGETS swiftrt DESTINATION "${CMAKE_INSTALL_LIBDIR} /swift" )
153153elseif ("${SwiftCore_OBJECT_FORMAT} " STREQUAL "coffx" )
154154 add_library (swiftrt OBJECT SwiftRT-COFF.cpp)
155+ target_compile_definitions (swiftrt PRIVATE
156+ $<$<NOT :$<BOOL :${BUILD_SHARED_LIBS} >>:SWIFT_STATIC_STDLIB>)
155157 target_link_libraries (swiftrt PRIVATE swiftShims)
156158 install (TARGETS swiftrt DESTINATION "${CMAKE_INSTALL_LIBDIR} /swift" )
157159elseif (NOT "${SwiftCore_OBJECT_FORMAT} " STREQUAL "x" )
Original file line number Diff line number Diff line change 168168// FIXME: this #else should be some sort of #elif Windows
169169#else // !__MACH__ && !__ELF__
170170
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
174178
175179#endif
176180
You can’t perform that action at this time.
0 commit comments