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

Replace .NET detection code with ClassDB::class_exists("CSharpScript"). #94680

Merged
merged 1 commit into from
Jul 24, 2024
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
2 changes: 1 addition & 1 deletion core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ ProjectSettings::ProjectSettings() {

PackedStringArray extensions;
extensions.push_back("gd");
if (Engine::get_singleton()->has_singleton("GodotSharp")) {
if (ClassDB::class_exists("CSharpScript")) {
extensions.push_back("cs");
}
extensions.push_back("gdshader");
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_asset_installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ void EditorAssetInstaller::_notification(int p_what) {
extension_icon_map["gdshader"] = get_editor_theme_icon(SNAME("Shader"));
extension_icon_map["gdshaderinc"] = get_editor_theme_icon(SNAME("TextFile"));
extension_icon_map["gd"] = get_editor_theme_icon(SNAME("GDScript"));
if (Engine::get_singleton()->has_singleton("GodotSharp")) {
if (ClassDB::class_exists("CSharpScript")) {
extension_icon_map["cs"] = get_editor_theme_icon(SNAME("CSharpScript"));
} else {
// Mark C# support as unavailable.
Expand Down
6 changes: 3 additions & 3 deletions platform/macos/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ String EditorExportPlatformMacOS::get_export_option_warning(const EditorExportPr

if (p_name == "codesign/codesign") {
if (dist_type == 2) {
if (codesign_tool == 2 && Engine::get_singleton()->has_singleton("GodotSharp")) {
if (codesign_tool == 2 && ClassDB::class_exists("CSharpScript")) {
return TTR("'rcodesign' doesn't support signing applications with embedded dynamic libraries (GDExtension or .NET).");
}
if (codesign_tool == 0) {
Expand Down Expand Up @@ -333,7 +333,7 @@ bool EditorExportPlatformMacOS::get_export_option_visibility(const EditorExportP
}

// These entitlements are required to run managed code, and are always enabled in Mono builds.
if (Engine::get_singleton()->has_singleton("GodotSharp")) {
if (ClassDB::class_exists("CSharpScript")) {
if (p_option == "codesign/entitlements/allow_jit_code_execution" || p_option == "codesign/entitlements/allow_unsigned_executable_memory" || p_option == "codesign/entitlements/allow_dyld_environment_variables") {
return false;
}
Expand Down Expand Up @@ -1989,7 +1989,7 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p
ent_f->store_line("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">");
ent_f->store_line("<plist version=\"1.0\">");
ent_f->store_line("<dict>");
if (Engine::get_singleton()->has_singleton("GodotSharp")) {
if (ClassDB::class_exists("CSharpScript")) {
// These entitlements are required to run managed code, and are always enabled in Mono builds.
ent_f->store_line("<key>com.apple.security.cs.allow-jit</key>");
ent_f->store_line("<true/>");
Expand Down
Loading