summaryrefslogtreecommitdiffstats
path: root/platform/macos/export/export_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/export/export_plugin.cpp')
-rw-r--r--platform/macos/export/export_plugin.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp
index 9c9d8fc1a4..73e2f2d45b 100644
--- a/platform/macos/export/export_plugin.cpp
+++ b/platform/macos/export/export_plugin.cpp
@@ -30,10 +30,7 @@
#include "export_plugin.h"
-#include "codesign.h"
-#include "lipo.h"
#include "logo_svg.gen.h"
-#include "macho.h"
#include "run_icon_svg.gen.h"
#include "core/io/image_loader.h"
@@ -43,6 +40,9 @@
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
#include "editor/editor_string_names.h"
+#include "editor/export/codesign.h"
+#include "editor/export/lipo.h"
+#include "editor/export/macho.h"
#include "editor/import/resource_importer_texture_settings.h"
#include "editor/themes/editor_scale.h"
#include "scene/resources/image_texture.h"
@@ -1237,8 +1237,16 @@ Error EditorExportPlatformMacOS::_code_sign_directory(const Ref<EditorExportPres
}
if (extensions_to_sign.has(current_file.get_extension())) {
- int ftype = MachO::get_filetype(current_file_path);
- Error code_sign_error{ _code_sign(p_preset, current_file_path, (ftype == 2 || ftype == 5) ? p_helper_ent_path : p_ent_path, false, (ftype == 2 || ftype == 5)) };
+ String ent_path = p_ent_path;
+ bool set_bundle_id = false;
+ if (FileAccess::exists(current_file_path)) {
+ int ftype = MachO::get_filetype(current_file_path);
+ if (ftype == 2 || ftype == 5) {
+ ent_path = p_helper_ent_path;
+ set_bundle_id = true;
+ }
+ }
+ Error code_sign_error{ _code_sign(p_preset, current_file_path, ent_path, false, set_bundle_id) };
if (code_sign_error != OK) {
return code_sign_error;
}
@@ -1358,8 +1366,16 @@ Error EditorExportPlatformMacOS::_copy_and_sign_files(Ref<DirAccess> &dir_access
err = _code_sign_directory(p_preset, p_in_app_path, p_ent_path, p_helper_ent_path, p_should_error_on_non_code_sign);
} else {
if (extensions_to_sign.has(p_in_app_path.get_extension())) {
- int ftype = MachO::get_filetype(p_in_app_path);
- err = _code_sign(p_preset, p_in_app_path, (ftype == 2 || ftype == 5) ? p_helper_ent_path : p_ent_path, false, (ftype == 2 || ftype == 5));
+ String ent_path = p_ent_path;
+ bool set_bundle_id = false;
+ if (FileAccess::exists(p_in_app_path)) {
+ int ftype = MachO::get_filetype(p_in_app_path);
+ if (ftype == 2 || ftype == 5) {
+ ent_path = p_helper_ent_path;
+ set_bundle_id = true;
+ }
+ }
+ err = _code_sign(p_preset, p_in_app_path, ent_path, false, set_bundle_id);
}
if (dir_access->file_exists(p_in_app_path) && is_executable(p_in_app_path)) {
// chmod with 0755 if the file is executable.