Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复 QCefView.framework 无法被 codesign 的问题 #192

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ if(OS_MACOS)

# create plugins directory
COMMAND mkdir -p
"$<TARGET_BUNDLE_DIR:QCefView>/PlugIns/"
"$<TARGET_BUNDLE_DIR:QCefView>/Resources/PlugIns/"

# copy the CefViewCore binaries to resource directory
COMMAND cp -a
"$<TARGET_BUNDLE_DIR:CefViewWing>/../"
"$<TARGET_BUNDLE_DIR:QCefView>/PlugIns/"
"$<TARGET_BUNDLE_DIR:QCefView>/Resources/PlugIns/"

# sign the cef framework
COMMAND codesign
--force
--sign -
"$<TARGET_BUNDLE_DIR:QCefView>/PlugIns/Chromium Embedded Framework.framework"
"$<TARGET_BUNDLE_DIR:QCefView>/Resources/PlugIns/Chromium Embedded Framework.framework"
)
endif() # OS_MACOS

Expand Down
7 changes: 5 additions & 2 deletions src/mac/details/QCefContextPrivate_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define CEF_FRAMEWORK_NAME "Chromium Embedded Framework.framework"
#define HELPER_BUNDLE_NAME "CefViewWing.app"
#define HELPER_BINARY_NAME "CefViewWing"
#define PLUGINS_NAME "PlugIns"

@interface PathFactory : NSObject
+ (NSString*) AppMainBundlePath;
Expand All @@ -28,13 +29,15 @@ + (NSString*) AppMainBundlePath {
}

+ (NSString*) CefFrameworkPath {
NSString* path = [[NSBundle bundleForClass:[PathFactory class]] builtInPlugInsPath];
NSString* path = [[NSBundle bundleForClass:[PathFactory class]] resourcePath];
path = [path stringByAppendingPathComponent:@PLUGINS_NAME];
path = [path stringByAppendingPathComponent:@CEF_FRAMEWORK_NAME];
return path;
}

+ (NSString*) CefSubprocessPath {
NSString* path = [[NSBundle bundleForClass:[PathFactory class]] builtInPlugInsPath];
NSString* path = [[NSBundle bundleForClass:[PathFactory class]] resourcePath];
path = [path stringByAppendingPathComponent:@PLUGINS_NAME];
path = [path stringByAppendingPathComponent:@HELPER_BUNDLE_NAME];
path = [path stringByAppendingPathComponent:@"Contents"];
path = [path stringByAppendingPathComponent:@"MacOS"];
Expand Down