QtCore.framework is a reasonable heuristic for detecting Qt

This commit is contained in:
Vladimir Kukushkin
2020-10-03 23:17:49 +03:00
parent 4f3ce04ce3
commit 8c8de98c3e
2 changed files with 9 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ struct ExecutableFileTechnologyInfo: Equatable {
static let swiftui = DetectedTechnologies(rawValue: 1 << 3)
static let uikit = DetectedTechnologies(rawValue: 1 << 4)
static let appkit = DetectedTechnologies(rawValue: 1 << 5)
static let qt = DetectedTechnologies(rawValue: 1 << 6)
static let objc = DetectedTechnologies(rawValue: 1 << 10)
static let swift = DetectedTechnologies(rawValue: 1 << 11)
@@ -57,6 +58,7 @@ extension ExecutableFileTechnologyInfo.DetectedTechnologies {
if check(.appkit, "AppKit.framework") { continue }
if check(.swiftui, "SwiftUI.framework") { continue }
if check(.uikit, "UIKit.framework") { continue }
if check(.qt, "QtCore.framework") { continue }
if check(.cplusplus, "libc++") { continue }
if check(.objc, "libobjc") { continue }

View File

@@ -59,6 +59,9 @@ fileprivate struct Texts {
static let java =
"Java. An actual app built using Java. Charles, is this you?"
static let qt =
"Qt. Anything can happen. Run."
}
fileprivate extension ExecutableFileTechnologyInfo {
@@ -94,6 +97,10 @@ fileprivate extension ExecutableFileTechnologyInfo {
return Texts.swiftui
}
if features(.qt) {
return Texts.qt
}
if features(.appkit) {
if features(.swift) { return Texts.appKitSwift }
return Texts.appKitObjC