Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
Fix to make Cordova OSX build successfully on AppleSilicon target.
Browse files Browse the repository at this point in the history
  • Loading branch information
bpresles committed Jul 5, 2020
1 parent b2c85ae commit 9d3a75f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CordovaLib/CordovaLib.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -426,6 +427,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = "include/$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = "i386 x86_64 arm64";
};
name = Debug;
};
Expand All @@ -438,6 +440,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PUBLIC_HEADERS_FOLDER_PATH = "include/$(TARGET_NAME)";
SKIP_INSTALL = YES;
VALID_ARCHS = "i386 x86_64 arm64";
};
name = Release;
};
Expand Down
3 changes: 2 additions & 1 deletion CordovaLib/CordovaLib/Classes/CDVBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ - (void) exec:(NSString*) callbackId withService:(NSString*) service andAction:(
SEL normalSelector = NSSelectorFromString(methodName);
if ([obj respondsToSelector:normalSelector]) {
// [obj performSelector:normalSelector withObject:command];
objc_msgSend(obj, normalSelector, command);
void* (*msgSend)(id, SEL, CDVInvokedUrlCommand*) = (typeof(msgSend)) &objc_msgSend;
msgSend(obj, normalSelector, command);
} else {
// There's no method to call, so throw an error.
NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.cmdClassName);
Expand Down
3 changes: 2 additions & 1 deletion CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ - (BOOL) execute:(CDVInvokedUrlCommand*) command {
// Test for the legacy selector first in case they both exist.
if ([obj respondsToSelector:normalSelector]) {
// [obj performSelector:normalSelector withObject:command];
objc_msgSend(obj, normalSelector, command);
void* (*msgSend)(id, SEL, CDVInvokedUrlCommand*) = (typeof(msgSend)) &objc_msgSend;
msgSend(obj, normalSelector, command);
} else {
// There's no method to call, so throw an error.
NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.cmdClassName);
Expand Down

0 comments on commit 9d3a75f

Please sign in to comment.