You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2022/02/01 19:31:22 UTC

[cordova-osx] branch master updated: Fix to make Cordova OSX build successfully on AppleSilicon target. (#105)

This is an automated email from the ASF dual-hosted git repository.

niklasmerz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-osx.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b1480d  Fix to make Cordova OSX build successfully on AppleSilicon target. (#105)
9b1480d is described below

commit 9b1480d20d6626c0f5a32294e002b87a0cb35c0a
Author: Bertrand Presles <b....@younup.fr>
AuthorDate: Tue Feb 1 20:31:13 2022 +0100

    Fix to make Cordova OSX build successfully on AppleSilicon target. (#105)
---
 CordovaLib/CordovaLib.xcodeproj/project.pbxproj          | 3 +++
 CordovaLib/CordovaLib/Classes/CDVBridge.m                | 3 ++-
 CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m | 3 ++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 255aaf7..5ec74dc 100644
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -301,6 +301,7 @@
 			developmentRegion = English;
 			hasScannedForEncodings = 0;
 			knownRegions = (
+				English,
 				en,
 				Base,
 			);
@@ -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;
 		};
@@ -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;
 		};
diff --git a/CordovaLib/CordovaLib/Classes/CDVBridge.m b/CordovaLib/CordovaLib/Classes/CDVBridge.m
index 7ba9ec1..2cea060 100644
--- a/CordovaLib/CordovaLib/Classes/CDVBridge.m
+++ b/CordovaLib/CordovaLib/Classes/CDVBridge.m
@@ -74,7 +74,8 @@
     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);
diff --git a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
index 4265f0b..e4c1060 100644
--- a/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
+++ b/CordovaLib/CordovaLib/Classes/Commands/CDVCommandQueue.m
@@ -143,7 +143,8 @@
     // 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);

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org