Start generating embedded Info.plist files for Swift dylibs.

Swift SVN r16511
This commit is contained in:
Ted Kremenek
2014-04-18 07:48:45 +00:00
parent 86a434ab4d
commit 423296e1fc
2 changed files with 38 additions and 0 deletions

View File

@@ -683,6 +683,28 @@ macro(add_swift_library name)
INSTALL_NAME_DIR "@rpath"
BUILD_WITH_INSTALL_RPATH YES)
endif()
# Configure plist creation for OS X.
set (PLIST_INFO_PLIST "Info.plist" CACHE STRING "Plist name")
if (APPLE AND SHARED_LIBRARY)
set(PLIST_INFO_NAME ${name})
set(PLIST_INFO_UTI "com.apple.dt.${name}")
set(PLIST_INFO_VERSION "1.0")
if (LLVM_SUBMIT_VERSION)
set(PLIST_INFO_BUILD_VERSION
"${LLVM_SUBMIT_VERSION}.${LLVM_SUBMIT_SUBVERSION}")
endif()
set(PLIST_INFO_PLIST_OUT "${PLIST_INFO_PLIST}")
target_link_libraries(${name}
"-Wl,-sectcreate,__TEXT,__info_plist,${PLIST_INFO_PLIST_OUT}")
configure_file("${SWIFT_SOURCE_DIR}/stdlib/${PLIST_INFO_PLIST}.in" "${PLIST_INFO_PLIST_OUT}" @ONLY)
set(PLIST_INFO_UTI)
set(PLIST_INFO_NAME)
set(PLIST_INFO_VERSION)
set(PLIST_INFO_BUILD_VERSION)
endif()
set_target_properties(${name} PROPERTIES FOLDER "Swift libraries")
endmacro(add_swift_library)

16
stdlib/Info.plist.in Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>@PLIST_INFO_UTI@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>@PLIST_INFO_NAME@</string>
<key>CFBundleShortVersionString</key>
<string>@PLIST_INFO_VERSION@</string>
<key>CFBundleVersion</key>
<string>@PLIST_INFO_BUILD_VERSION@</string>
</dict>
</plist>