瀏覽代碼

Merge pull request #106383 from bruvzg/macos_isdef

Fix macOS build with `dev_build=yes` and `target=template_debug`
Thaddeus Crews 3 月之前
父節點
當前提交
ae68a216b9
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      platform/macos/godot_application.mm

+ 5 - 2
platform/macos/godot_application.mm

@@ -63,11 +63,14 @@ GodotApplication *GodotApp = nil;
 	NSString *nsbundleid_env = [NSString stringWithUTF8String:(bundled_id != nullptr) ? bundled_id : ""];
 	NSString *nsbundleid_env = [NSString stringWithUTF8String:(bundled_id != nullptr) ? bundled_id : ""];
 	NSString *nsbundleid = [[NSBundle mainBundle] bundleIdentifier];
 	NSString *nsbundleid = [[NSBundle mainBundle] bundleIdentifier];
 	if (nsappname == nil || isatty(STDOUT_FILENO) || isatty(STDIN_FILENO) || isatty(STDERR_FILENO) || ![nsbundleid isEqualToString:nsbundleid_env]) {
 	if (nsappname == nil || isatty(STDOUT_FILENO) || isatty(STDIN_FILENO) || isatty(STDERR_FILENO) || ![nsbundleid isEqualToString:nsbundleid_env]) {
-#if DEV_ENABLED
-		if (!OS_MacOS::is_debugger_attached())
+#ifdef TOOLS_ENABLED
+		if (!OS_MacOS::is_debugger_attached()) {
+#else
+		{
 #endif
 #endif
 			// If the executable is started from terminal or is not bundled, macOS WindowServer won't register and activate app window correctly (menu and title bar are grayed out and input ignored).
 			// If the executable is started from terminal or is not bundled, macOS WindowServer won't register and activate app window correctly (menu and title bar are grayed out and input ignored).
 			[self performSelector:@selector(forceUnbundledWindowActivationHackStep1) withObject:nil afterDelay:0.02];
 			[self performSelector:@selector(forceUnbundledWindowActivationHackStep1) withObject:nil afterDelay:0.02];
+		}
 	}
 	}
 }
 }