@@ -250,8 +250,6 @@ if(NOT LINUX AND NOT ANDROID)
250
250
target_sources (swiftCore PRIVATE ObjectIdentifier+DebugDescription.swift )
251
251
endif ()
252
252
253
- set_target_properties (swiftCore PROPERTIES Swift_MODULE_NAME Swift )
254
-
255
253
if (SwiftCore_ENABLE_COMMANDLINE_SUPPORT )
256
254
target_sources (swiftCore PRIVATE CommandLine.swift )
257
255
target_link_libraries (swiftCore PRIVATE swiftCommandLineSupport )
@@ -271,11 +269,18 @@ if(SwiftCore_ENABLE_VECTOR_TYPES)
271
269
"${CMAKE_CURRENT_BINARY_DIR} /SIMDVectorTypes.swift" )
272
270
endif ()
273
271
274
- if (APPLE AND BUILD_SHARED_LIBS )
275
- target_link_options (swiftCore PRIVATE "SHELL:-Xlinker -headerpad_max_install_names" )
276
- endif ()
272
+ set_target_properties (swiftCore PROPERTIES Swift_MODULE_NAME Swift )
273
+
274
+ target_compile_definitions (swiftCore
275
+ PRIVATE
276
+ $< $< BOOL:${SwiftCore_ENABLE_REFLECTION} > :-DSWIFT_ENABLE_REFLECTION>
277
+ $< $< BOOL:${SwiftCore_ENABLE_COMPACT_ABSOLUTE_FUNCTION_POINTERS} > :-DSWIFT_COMPACT_ABSOLUTE_FUNCTION_POINTER>
278
+ $< $< COMPILE_LANGUAGE:C,CXX> :-DSWIFT_TARGET_LIBRARY_NAME=swiftCore>
279
+ INTERFACE
280
+ $< $< BOOL:${SwiftCore_ENABLE_VECTOR_TYPES} > :-DSWIFT_STDLIB_ENABLE_VECTOR_TYPES> )
277
281
278
282
target_compile_options (swiftCore PRIVATE
283
+ "$<$<AND:$<COMPILE_LANGUAGE:Swift>,$<BOOL:${BUILD_SHARED_LIBS} >>:SHELL:-Xcc -DswiftCore_EXPORTS>"
279
284
# STAGING: Temporarily avoids having to write #fileID in Swift.swiftinterface.
280
285
# see also 327ea8bce2d1107a847d444651b19ca6a2901c9e
281
286
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -enable-experimental-concise-pound-file>"
@@ -293,16 +298,6 @@ if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
293
298
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-partial-specialization>" )
294
299
endif ()
295
300
296
- target_compile_definitions (swiftCore
297
- PRIVATE
298
- $< $< BOOL:${SwiftCore_ENABLE_REFLECTION} > :-DSWIFT_ENABLE_REFLECTION>
299
- $< $< BOOL:${SwiftCore_ENABLE_COMPACT_ABSOLUTE_FUNCTION_POINTERS} > :-DSWIFT_COMPACT_ABSOLUTE_FUNCTION_POINTER>
300
- $< $< COMPILE_LANGUAGE:C,CXX> :-DSWIFT_TARGET_LIBRARY_NAME=swiftCore>
301
- INTERFACE
302
- $< $< BOOL:${SwiftCore_ENABLE_VECTOR_TYPES} > :-DSWIFT_STDLIB_ENABLE_VECTOR_TYPES> )
303
- target_compile_options (swiftCore PRIVATE
304
- "$<$<AND:$<BOOL:${BUILD_SHARED_LIBS} >,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xcc -DswiftCore_EXPORTS>" )
305
-
306
301
target_link_libraries (swiftCore
307
302
PRIVATE
308
303
swiftRuntime
@@ -313,8 +308,7 @@ target_link_libraries(swiftCore
313
308
$< $< NOT:$< PLATFORM_ID:Darwin> > :swiftrt$< $< PLATFORM_ID:Windows> :T> >
314
309
PUBLIC
315
310
swiftShims )
316
- target_link_options (swiftCore PUBLIC
317
- $< $< LINK_LANGUAGE:Swift> :-nostartfiles> )
311
+
318
312
string (TOLOWER "${SwiftCore_OBJECT_FORMAT} " SwiftCore_OBJECT_FORMAT_lc )
319
313
if ("${SwiftCore_OBJECT_FORMAT_lc} " STREQUAL "elf" )
320
314
target_link_libraries (swiftCore INTERFACE
@@ -323,6 +317,10 @@ elseif("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "coff")
323
317
target_link_libraries (swiftCore INTERFACE
324
318
swiftrt$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:T> )
325
319
endif ()
320
+
321
+ target_link_options (swiftCore PUBLIC
322
+ $< $< LINK_LANGUAGE:Swift> :-nostartfiles> )
323
+
326
324
if (NOT POLICY CMP0157 )
327
325
target_compile_options (swiftCore PRIVATE
328
326
$< TARGET_OBJECTS:swiftRuntime>
@@ -337,6 +335,10 @@ if(NOT ANDROID AND NOT APPLE AND NOT LINUX AND NOT WIN32 AND UNIX)
337
335
target_link_libraries (swiftCore PRIVATE "${EXECINFO_LIBRARY} " )
338
336
endif ()
339
337
338
+ if (APPLE AND BUILD_SHARED_LIBS )
339
+ target_link_options (swiftCore PRIVATE "SHELL:-Xlinker -headerpad_max_install_names" )
340
+ endif ()
341
+
340
342
install (TARGETS swiftCore
341
343
EXPORT SwiftCoreTargets
342
344
COMPONENT SwiftCore_runtime
0 commit comments