forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
90 lines (78 loc) · 2.56 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
set(swift_runtime_compile_flags ${SWIFT_CORE_CXX_FLAGS})
if(SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS)
list(APPEND swift_runtime_compile_flags
"-DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=1")
endif()
if(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT)
list(APPEND swift_runtime_compile_flags
"-DSWIFT_HAVE_CRASHREPORTERCLIENT=1")
endif()
set(swift_runtime_leaks_sources)
if(SWIFT_RUNTIME_ENABLE_LEAK_CHECKER)
list(APPEND swift_runtime_compile_flags
"-DSWIFT_RUNTIME_ENABLE_LEAK_CHECKER=1")
set(swift_runtime_leaks_sources Leaks.mm)
endif()
set(swift_runtime_dtrace_sources)
if (SWIFT_RUNTIME_ENABLE_DTRACE)
set(swift_runtime_dtrace_sources SwiftRuntimeDTraceProbes.d)
list(APPEND swift_runtime_compile_flags
"-DSWIFT_RUNTIME_ENABLE_DTRACE=1")
endif()
# Acknowledge that the following sources are known.
set(LLVM_OPTIONAL_SOURCES
Remangle.cpp)
set(swift_runtime_objc_sources)
set(swift_runtime_unicode_normalization_sources)
set(swift_runtime_link_libraries)
if(SWIFT_HOST_VARIANT MATCHES "${SWIFT_DARWIN_VARIANTS}")
set(swift_runtime_objc_sources
ErrorObject.mm
SwiftObject.mm
Remangle.cpp
Reflection.mm)
set(LLVM_OPTIONAL_SOURCES
UnicodeNormalization.cpp)
else()
find_package(ICU REQUIRED COMPONENTS uc i18n)
set(swift_runtime_unicode_normalization_sources
UnicodeNormalization.cpp)
set(swift_runtime_link_libraries
${ICU_UC_LIBRARY} ${ICU_I18N_LIBRARY})
include_directories(
${ICU_UC_INCLUDE_DIR} ${ICU_I18N_INCLUDE_DIR})
endif()
add_swift_library(swiftRuntime IS_STDLIB IS_STDLIB_CORE
Casting.cpp
Demangle.cpp
Enum.cpp
ErrorObject.cpp
Errors.cpp
Heap.cpp
HeapObject.cpp
KnownMetadata.cpp
Metadata.cpp
Once.cpp
Reflection.cpp
SwiftObject.cpp
UnicodeExtendedGraphemeClusters.cpp.gyb
${swift_runtime_objc_sources}
${swift_runtime_dtrace_sources}
${swift_runtime_leaks_sources}
${swift_runtime_unicode_normalization_sources}
C_COMPILE_FLAGS ${swift_runtime_compile_flags}
LINK_LIBRARIES ${swift_runtime_link_libraries}
INSTALL_IN_COMPONENT stdlib)
foreach(sdk ${SWIFT_CONFIGURED_SDKS})
if("${sdk}" STREQUAL "LINUX" OR "${sdk}" STREQUAL "FREEBSD")
foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
set(arch_subdir "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}")
# FIXME: We will need a different linker script for 32-bit builds.
configure_file(
"swift.ld" "${SWIFTLIB_DIR}/${arch_subdir}/swift.ld" COPYONLY)
swift_install_in_component(compiler
FILES "swift.ld"
DESTINATION "lib/swift/${arch_subdir}")
endforeach()
endif()
endforeach()