mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 06:45:37 +08:00
Build MacOS executables as bundles
This commit is contained in:
@@ -117,7 +117,7 @@ if(SWIFT_USE_CRASHPAD)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_INSTALL_RPATH @loader_path/../lib)
|
||||
set(CMAKE_INSTALL_RPATH @loader_path/../../../../lib)
|
||||
elseif(UNIX)
|
||||
set(CMAKE_INSTALL_RPATH \$ORIGIN/../lib)
|
||||
endif()
|
||||
|
||||
@@ -384,11 +384,14 @@ class MacOSBuilder(Builder):
|
||||
return True
|
||||
|
||||
def _strip_debug(self):
|
||||
bundle_files = [
|
||||
"bin/swiftcore.app/Contents/MacOS/swiftcore",
|
||||
"bin/swiftdata.app/Contents/MacOS/swiftdata",
|
||||
"bin/swiftguistd.app/Contents/MacOS/swiftguistd",
|
||||
"bin/swiftlauncher.app/Contents/MacOS/swiftlauncher",
|
||||
]
|
||||
|
||||
files = [
|
||||
"bin/swiftcore",
|
||||
"bin/swiftdata",
|
||||
"bin/swiftguistd",
|
||||
"bin/swiftlauncher",
|
||||
"lib/libcore.dylib",
|
||||
"lib/libgui.dylib",
|
||||
"lib/libinput.dylib",
|
||||
@@ -405,6 +408,11 @@ class MacOSBuilder(Builder):
|
||||
"xswiftbus/64/mac.xpl",
|
||||
]
|
||||
dist_path = path.join(self._get_swift_source_path(), "dist")
|
||||
|
||||
# Put output of bundle files directly in bin folder
|
||||
for file in bundle_files:
|
||||
subprocess.check_call(["dsymutil", path.join(dist_path, file), "-o", path.join(dist_path, "bin", file.split("/")[-1] + ".dSYM")], env=dict(os.environ))
|
||||
|
||||
for file in files:
|
||||
subprocess.check_call(["dsymutil", path.join(dist_path, file)], env=dict(os.environ))
|
||||
|
||||
|
||||
@@ -22,10 +22,22 @@ target_link_libraries(swiftcore
|
||||
core
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(swiftcore PROPERTIES MACOSX_BUNDLE TRUE)
|
||||
set_target_properties(swiftcore PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
||||
set(RESOURCE_FILES swiftcore.icns qt.conf)
|
||||
target_sources(swiftcore PRIVATE ${RESOURCE_FILES})
|
||||
set_target_properties(swiftcore PROPERTIES RESOURCE "${RESOURCE_FILES}")
|
||||
endif()
|
||||
|
||||
add_dependencies(swiftcore resources)
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies(swiftcore copy_externals_to_build_dir)
|
||||
endif()
|
||||
|
||||
install(TARGETS swiftcore)
|
||||
if(APPLE)
|
||||
install(TARGETS swiftcore BUNDLE DESTINATION bin)
|
||||
else()
|
||||
install(TARGETS swiftcore)
|
||||
endif()
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>swift core</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<string>swiftcore</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>swift project - free and open source pilot client</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
|
||||
<string>swiftcore.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<string>org.swift-project.swiftcore</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
|
||||
<string>????</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<string>10.13</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
|
||||
@@ -23,10 +23,22 @@ target_link_libraries(swiftdata
|
||||
core
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(swiftdata PROPERTIES MACOSX_BUNDLE TRUE)
|
||||
set_target_properties(swiftdata PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
||||
set(RESOURCE_FILES swiftdata.icns qt.conf)
|
||||
target_sources(swiftdata PRIVATE ${RESOURCE_FILES})
|
||||
set_target_properties(swiftdata PROPERTIES RESOURCE "${RESOURCE_FILES}")
|
||||
endif()
|
||||
|
||||
add_dependencies(swiftdata resources)
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies(swiftdata copy_externals_to_build_dir)
|
||||
endif()
|
||||
|
||||
install(TARGETS swiftdata)
|
||||
if(APPLE)
|
||||
install(TARGETS swiftdata BUNDLE DESTINATION bin)
|
||||
else()
|
||||
install(TARGETS swiftdata)
|
||||
endif()
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>swift data</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<string>swiftdata</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>swift project - free and open source pilot client</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
|
||||
<string>swiftdata.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<string>org.swift-project.swiftdata</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
|
||||
<string>????</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<string>10.13</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
|
||||
@@ -28,10 +28,22 @@ target_link_libraries(swiftguistd
|
||||
sound
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(swiftguistd PROPERTIES MACOSX_BUNDLE TRUE)
|
||||
set_target_properties(swiftguistd PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
||||
set(RESOURCE_FILES swift.icns qt.conf)
|
||||
target_sources(swiftguistd PRIVATE ${RESOURCE_FILES})
|
||||
set_target_properties(swiftguistd PROPERTIES RESOURCE "${RESOURCE_FILES}")
|
||||
endif()
|
||||
|
||||
add_dependencies(swiftguistd resources)
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies(swiftguistd copy_externals_to_build_dir)
|
||||
endif()
|
||||
|
||||
install(TARGETS swiftguistd)
|
||||
if(APPLE)
|
||||
install(TARGETS swiftguistd BUNDLE DESTINATION bin)
|
||||
else()
|
||||
install(TARGETS swiftguistd)
|
||||
endif()
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>swift gui</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<string>swiftguistd</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>swift project - free and open source pilot client</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
|
||||
<string>swift.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<string>org.swift-project.swiftguistd</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
|
||||
<string>????</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<string>10.13</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
|
||||
@@ -23,10 +23,22 @@ target_link_libraries(swiftlauncher
|
||||
core
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(swiftlauncher PROPERTIES MACOSX_BUNDLE TRUE)
|
||||
set_target_properties(swiftlauncher PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
||||
set(RESOURCE_FILES swiftlauncher.icns qt.conf)
|
||||
target_sources(swiftlauncher PRIVATE ${RESOURCE_FILES})
|
||||
set_target_properties(swiftlauncher PROPERTIES RESOURCE "${RESOURCE_FILES}")
|
||||
endif()
|
||||
|
||||
add_dependencies(swiftlauncher resources)
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies(swiftlauncher copy_externals_to_build_dir)
|
||||
endif()
|
||||
|
||||
install(TARGETS swiftlauncher)
|
||||
if(APPLE)
|
||||
install(TARGETS swiftlauncher BUNDLE DESTINATION bin)
|
||||
else()
|
||||
install(TARGETS swiftlauncher)
|
||||
endif()
|
||||
|
||||
@@ -7,19 +7,19 @@
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>swift launcher</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<string>swiftlauncher</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>swift project - free and open source pilot client</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
|
||||
<string>swiftlauncher.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<string>org.swift-project.swiftlauncher</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
|
||||
<string>????</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<string>10.13</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
|
||||
Reference in New Issue
Block a user