@@ -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>"
@@ -295,16 +300,6 @@ if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
295
300
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xllvm -sil-partial-specialization>" )
296
301
endif ()
297
302
298
- target_compile_definitions (swiftCore
299
- PRIVATE
300
- $< $< BOOL:${SwiftCore_ENABLE_REFLECTION} > :-DSWIFT_ENABLE_REFLECTION>
301
- $< $< BOOL:${SwiftCore_ENABLE_COMPACT_ABSOLUTE_FUNCTION_POINTERS} > :-DSWIFT_COMPACT_ABSOLUTE_FUNCTION_POINTER>
302
- $< $< COMPILE_LANGUAGE:C,CXX> :-DSWIFT_TARGET_LIBRARY_NAME=swiftCore>
303
- INTERFACE
304
- $< $< BOOL:${SwiftCore_ENABLE_VECTOR_TYPES} > :-DSWIFT_STDLIB_ENABLE_VECTOR_TYPES> )
305
- target_compile_options (swiftCore PRIVATE
306
- "$<$<AND:$<BOOL:${BUILD_SHARED_LIBS} >,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xcc -DswiftCore_EXPORTS>" )
307
-
308
303
target_link_libraries (swiftCore
309
304
PRIVATE
310
305
swiftRuntime
@@ -315,8 +310,7 @@ target_link_libraries(swiftCore
315
310
$< $< NOT:$< PLATFORM_ID:Darwin> > :swiftrt$< $< PLATFORM_ID:Windows> :T> >
316
311
PUBLIC
317
312
swiftShims )
318
- target_link_options (swiftCore PUBLIC
319
- $< $< LINK_LANGUAGE:Swift> :-nostartfiles> )
313
+
320
314
string (TOLOWER "${SwiftCore_OBJECT_FORMAT} " SwiftCore_OBJECT_FORMAT_lc )
321
315
if ("${SwiftCore_OBJECT_FORMAT_lc} " STREQUAL "elf" )
322
316
target_link_libraries (swiftCore INTERFACE
@@ -325,6 +319,10 @@ elseif("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "coff")
325
319
target_link_libraries (swiftCore INTERFACE
326
320
swiftrt$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:T> )
327
321
endif ()
322
+
323
+ target_link_options (swiftCore PUBLIC
324
+ $< $< LINK_LANGUAGE:Swift> :-nostartfiles> )
325
+
328
326
if (NOT POLICY CMP0157 )
329
327
target_compile_options (swiftCore PRIVATE
330
328
$< TARGET_OBJECTS:swiftRuntime>
@@ -339,6 +337,10 @@ if(NOT ANDROID AND NOT APPLE AND NOT LINUX AND NOT WIN32 AND UNIX)
339
337
target_link_libraries (swiftCore PRIVATE "${EXECINFO_LIBRARY} " )
340
338
endif ()
341
339
340
+ if (APPLE AND BUILD_SHARED_LIBS )
341
+ target_link_options (swiftCore PRIVATE "SHELL:-Xlinker -headerpad_max_install_names" )
342
+ endif ()
343
+
342
344
install (TARGETS swiftCore
343
345
EXPORT SwiftCoreTargets
344
346
COMPONENT SwiftCore_runtime
0 commit comments