mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This adds the swift include path manually to the builds for the stubs and the runtime. This has no impact for the build currently. However, adding the additional include directory will enable a standalone build for the stdlib.
50 lines
1.5 KiB
CMake
50 lines
1.5 KiB
CMake
set(swift_stubs_sources
|
|
Assert.cpp
|
|
CommandLine.cpp
|
|
GlobalObjects.cpp
|
|
KeyPaths.cpp
|
|
LibcShims.cpp
|
|
Stubs.cpp
|
|
)
|
|
set(swift_stubs_objc_sources
|
|
Availability.mm
|
|
FoundationHelpers.mm
|
|
OptionalBridgingHelper.mm
|
|
Reflection.mm
|
|
SwiftNativeNSXXXBaseARC.m
|
|
SwiftNativeNSXXXBase.mm.gyb)
|
|
set(swift_stubs_unicode_normalization_sources
|
|
UnicodeNormalization.cpp)
|
|
set(LLVM_OPTIONAL_SOURCES
|
|
${swift_stubs_objc_sources}
|
|
${swift_stubs_unicode_normalization_sources})
|
|
|
|
# ICU isn't required on Darwin, but is on every other platform.
|
|
# Now in case we're cross-compiling from Darwin for another platform,
|
|
# the find_package should still be executed.
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
set(icu_required "")
|
|
else()
|
|
set(icu_required "REQUIRED")
|
|
endif()
|
|
|
|
find_package(ICU ${icu_required} COMPONENTS uc)
|
|
set(ICU_UC_LIBRARY "")
|
|
|
|
set(swift_stubs_c_compile_flags ${SWIFT_RUNTIME_CORE_CXX_FLAGS})
|
|
list(APPEND swift_stubs_c_compile_flags -DswiftCore_EXPORTS)
|
|
list(APPEND swift_stubs_c_compile_flags -I${SWIFT_SOURCE_DIR}/include)
|
|
|
|
add_swift_library(swiftStdlibStubs OBJECT_LIBRARY TARGET_LIBRARY
|
|
${swift_stubs_sources}
|
|
${swift_stubs_objc_sources}
|
|
${swift_stubs_unicode_normalization_sources}
|
|
C_COMPILE_FLAGS ${swift_stubs_c_compile_flags}
|
|
LINK_FLAGS ${SWIFT_RUNTIME_CORE_LINK_FLAGS}
|
|
INSTALL_IN_COMPONENT stdlib)
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
set_property(SOURCE SwiftNativeNSXXXBaseARC.m APPEND_STRING PROPERTY COMPILE_FLAGS
|
|
"-fobjc-arc")
|
|
endif()
|