Skip to content

Commit

Permalink
Merge pull request #63225 from bruvzg/mac_rename
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Jul 21, 2022
2 parents e63ddd9 + 8823eae commit a9e4eac
Show file tree
Hide file tree
Showing 245 changed files with 1,151 additions and 1,149 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ doc_classes/* @godotengine/documentation
# Platform

/platform/android/ @godotengine/android
/platform/iphone/ @godotengine/ios
/platform/ios/ @godotengine/ios
/platform/javascript/ @godotengine/html5
/platform/linuxbsd/ @godotengine/linux-bsd
/platform/osx/ @godotengine/macos
/platform/macos/ @godotengine/macos
/platform/uwp/ @godotengine/uwp
/platform/windows/ @godotengine/windows

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }}
platform: iphone
platform: ios
target: release
tools: false
tests: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
target: release_debug
tools: true
tests: true
bin: "./bin/godot.osx.opt.tools.64"
bin: "./bin/godot.macos.opt.tools.64"

- name: Template (target=release, tools=no)
cache-name: macos-template
Expand All @@ -49,7 +49,7 @@ jobs:
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }}
platform: osx
platform: macos
target: ${{ matrix.target }}
tools: ${{ matrix.tools }}
tests: ${{ matrix.tests }}
Expand Down
18 changes: 16 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ else:
):
selected_platform = "linuxbsd"
elif sys.platform == "darwin":
selected_platform = "osx"
selected_platform = "macos"
elif sys.platform == "win32":
selected_platform = "windows"
else:
Expand All @@ -272,6 +272,20 @@ else:
if selected_platform != "":
print("Automatically detected platform: " + selected_platform)

if selected_platform in ["macos", "osx"]:
if selected_platform == "osx":
# Deprecated alias kept for compatibility.
print('Platform "osx" has been renamed to "macos" in Godot 4.0. Building for platform "macos".')
# Alias for convenience.
selected_platform = "macos"

if selected_platform in ["ios", "iphone"]:
if selected_platform == "iphone":
# Deprecated alias kept for compatibility.
print('Platform "iphone" has been renamed to "ios" in Godot 4.0. Building for platform "ios".')
# Alias for convenience.
selected_platform = "ios"

if selected_platform in ["linux", "bsd", "x11"]:
if selected_platform == "x11":
# Deprecated alias kept for compatibility.
Expand Down Expand Up @@ -554,7 +568,7 @@ if selected_platform in platform_list:
)
# Apple LLVM versions differ from upstream LLVM version \o/, compare
# in https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
elif env["platform"] == "osx" or env["platform"] == "iphone":
elif env["platform"] == "macos" or env["platform"] == "ios":
vanilla = methods.is_vanilla_clang(env)
if vanilla and cc_version_major < 6:
print(
Expand Down
2 changes: 1 addition & 1 deletion core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ if env["builtin_zstd"]:
"decompress/zstd_decompress_block.c",
"decompress/zstd_decompress.c",
]
if env["platform"] in ["android", "iphone", "linuxbsd", "osx"]:
if env["platform"] in ["android", "ios", "linuxbsd", "macos"]:
# Match platforms with ZSTD_ASM_SUPPORTED in common/portability_macros.h
thirdparty_zstd_sources.append("decompress/huf_decompress_amd64.S")
thirdparty_zstd_sources = [thirdparty_zstd_dir + file for file in thirdparty_zstd_sources]
Expand Down
2 changes: 1 addition & 1 deletion core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
// We need to test both possibilities as extensions for Linux binaries are optional
// (so both 'mygame.bin' and 'mygame' should be able to find 'mygame.pck').

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
if (!found) {
// Attempt to load PCK from macOS .app bundle resources.
found = _load_resource_pack(OS::get_singleton()->get_bundle_resource_dir().plus_file(exec_basename + ".pck")) || _load_resource_pack(OS::get_singleton()->get_bundle_resource_dir().plus_file(exec_filename + ".pck"));
Expand Down
4 changes: 2 additions & 2 deletions core/input/input_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def make_default_controller_mappings(target, source, env):
platform_variables = {
"Linux": "#if X11_ENABLED",
"Windows": "#ifdef WINDOWS_ENABLED",
"Mac OS X": "#ifdef OSX_ENABLED",
"Mac OS X": "#ifdef MACOS_ENABLED",
"Android": "#if defined(__ANDROID__)",
"iOS": "#ifdef IPHONE_ENABLED",
"iOS": "#ifdef IOS_ENABLED",
"Javascript": "#ifdef JAVASCRIPT_ENABLED",
"UWP": "#ifdef UWP_ENABLED",
}
Expand Down
2 changes: 1 addition & 1 deletion core/os/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static const _KeyCodeText _keycodes[] = {
{Key::PAGEDOWN ,"PageDown"},
{Key::SHIFT ,"Shift"},
{Key::CTRL ,"Ctrl"},
#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
{Key::META ,"Command"},
#else
{Key::META ,"Meta"},
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/EditorExportPlugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
Adds a static lib from the given [code]path[/code] to the iOS project.
</description>
</method>
<method name="add_osx_plugin_file">
<method name="add_macos_plugin_file">
<return type="void" />
<argument index="0" name="path" type="String" />
<description>
Expand Down
20 changes: 10 additions & 10 deletions drivers/coreaudio/audio_driver_coreaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define kOutputBus 0
#define kInputBus 1

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
OSStatus AudioDriverCoreAudio::input_device_address_cb(AudioObjectID inObjectID,
UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses,
void *inClientData) {
Expand Down Expand Up @@ -72,7 +72,7 @@ Error AudioDriverCoreAudio::init() {
AudioComponentDescription desc;
memset(&desc, 0, sizeof(desc));
desc.componentType = kAudioUnitType_Output;
#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
desc.componentSubType = kAudioUnitSubType_HALOutput;
#else
desc.componentSubType = kAudioUnitSubType_RemoteIO;
Expand All @@ -85,7 +85,7 @@ Error AudioDriverCoreAudio::init() {
OSStatus result = AudioComponentInstanceNew(comp, &audio_unit);
ERR_FAIL_COND_V(result != noErr, FAILED);

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
AudioObjectPropertyAddress prop;
prop.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
prop.mScope = kAudioObjectPropertyScopeGlobal;
Expand Down Expand Up @@ -135,7 +135,7 @@ Error AudioDriverCoreAudio::init() {
// Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels)
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
result = AudioUnitSetProperty(audio_unit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, kOutputBus, &buffer_frames, sizeof(UInt32));
ERR_FAIL_COND_V(result != noErr, FAILED);
#endif
Expand Down Expand Up @@ -313,7 +313,7 @@ void AudioDriverCoreAudio::finish() {
ERR_PRINT("AudioUnitUninitialize failed");
}

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
AudioObjectPropertyAddress prop;
prop.mSelector = kAudioHardwarePropertyDefaultOutputDevice;
prop.mScope = kAudioObjectPropertyScopeGlobal;
Expand All @@ -339,7 +339,7 @@ Error AudioDriverCoreAudio::capture_init() {
AudioComponentDescription desc;
memset(&desc, 0, sizeof(desc));
desc.componentType = kAudioUnitType_Output;
#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
desc.componentSubType = kAudioUnitSubType_HALOutput;
#else
desc.componentSubType = kAudioUnitSubType_RemoteIO;
Expand All @@ -352,7 +352,7 @@ Error AudioDriverCoreAudio::capture_init() {
OSStatus result = AudioComponentInstanceNew(comp, &input_unit);
ERR_FAIL_COND_V(result != noErr, FAILED);

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
AudioObjectPropertyAddress prop;
prop.mSelector = kAudioHardwarePropertyDefaultInputDevice;
prop.mScope = kAudioObjectPropertyScopeGlobal;
Expand All @@ -370,7 +370,7 @@ Error AudioDriverCoreAudio::capture_init() {
ERR_FAIL_COND_V(result != noErr, FAILED);

UInt32 size;
#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
AudioDeviceID deviceId;
size = sizeof(AudioDeviceID);
AudioObjectPropertyAddress property = { kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
Expand Down Expand Up @@ -447,7 +447,7 @@ void AudioDriverCoreAudio::capture_finish() {
ERR_PRINT("AudioUnitUninitialize failed");
}

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
AudioObjectPropertyAddress prop;
prop.mSelector = kAudioHardwarePropertyDefaultInputDevice;
prop.mScope = kAudioObjectPropertyScopeGlobal;
Expand Down Expand Up @@ -491,7 +491,7 @@ Error AudioDriverCoreAudio::capture_stop() {
return OK;
}

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED

Array AudioDriverCoreAudio::_get_device_list(bool capture) {
Array list;
Expand Down
6 changes: 3 additions & 3 deletions drivers/coreaudio/audio_driver_coreaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "servers/audio_server.h"

#import <AudioUnit/AudioUnit.h>
#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
#import <CoreAudio/AudioHardware.h>
#endif

Expand All @@ -58,7 +58,7 @@ class AudioDriverCoreAudio : public AudioDriver {
Vector<int32_t> samples_in;
Vector<int16_t> input_buf;

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
Array _get_device_list(bool capture = false);
void _set_device(const String &device, bool capture = false);

Expand Down Expand Up @@ -106,7 +106,7 @@ class AudioDriverCoreAudio : public AudioDriver {
bool try_lock();
void stop();

#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
virtual Array get_device_list();
virtual String get_device();
virtual void set_device(String device);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gl_context/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Import("env")

if env["platform"] in ["haiku", "osx", "windows", "linuxbsd"]:
if env["platform"] in ["haiku", "macos", "windows", "linuxbsd"]:
# Thirdparty source files
thirdparty_dir = "#thirdparty/glad/"
thirdparty_sources = [
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#endif
#endif

#if !defined(IPHONE_ENABLED) && !defined(JAVASCRIPT_ENABLED)
#if !defined(IOS_ENABLED) && !defined(JAVASCRIPT_ENABLED)
// We include EGL below to get debug callback on GLES2 platforms,
// but EGL is not available on iOS.
#define CAN_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/os_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#include <time.h>
#include <unistd.h>

#if defined(OSX_ENABLED) || (defined(__ANDROID_API__) && __ANDROID_API__ >= 28)
#if defined(MACOS_ENABLED) || (defined(__ANDROID_API__) && __ANDROID_API__ >= 28)
// Random location for getentropy. Fitting.
#include <sys/random.h>
#define UNIX_GET_ENTROPY
Expand Down
6 changes: 3 additions & 3 deletions drivers/vulkan/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ if env["use_volk"]:

if env["platform"] == "android":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_ANDROID_KHR"])
elif env["platform"] == "iphone":
elif env["platform"] == "ios":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_IOS_MVK"])
elif env["platform"] == "linuxbsd" and env["x11"]:
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_XLIB_KHR"])
elif env["platform"] == "osx":
elif env["platform"] == "macos":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_MACOS_MVK"])
elif env["platform"] == "windows":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_WIN32_KHR"])
Expand All @@ -40,7 +40,7 @@ elif env["platform"] == "android":
# Our current NDK version only provides old Vulkan headers,
# so we have to limit VMA.
env_thirdparty_vma.AppendUnique(CPPDEFINES=["VMA_VULKAN_VERSION=1000000"])
elif env["platform"] == "osx" or env["platform"] == "iphone":
elif env["platform"] == "macos" or env["platform"] == "ios":
# MoltenVK supports only Vulkan 1.1 API, limit VMA to the same version.
env_thirdparty_vma.AppendUnique(CPPDEFINES=["VMA_VULKAN_VERSION=1001000"])

Expand Down
10 changes: 5 additions & 5 deletions editor/editor_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,12 @@ String EditorExportPlugin::get_ios_cpp_code() const {
return ios_cpp_code;
}

void EditorExportPlugin::add_osx_plugin_file(const String &p_path) {
osx_plugin_files.push_back(p_path);
void EditorExportPlugin::add_macos_plugin_file(const String &p_path) {
macos_plugin_files.push_back(p_path);
}

const Vector<String> &EditorExportPlugin::get_osx_plugin_files() const {
return osx_plugin_files;
const Vector<String> &EditorExportPlugin::get_macos_plugin_files() const {
return macos_plugin_files;
}

void EditorExportPlugin::add_ios_project_static_lib(const String &p_path) {
Expand Down Expand Up @@ -746,7 +746,7 @@ void EditorExportPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_ios_linker_flags", "flags"), &EditorExportPlugin::add_ios_linker_flags);
ClassDB::bind_method(D_METHOD("add_ios_bundle_file", "path"), &EditorExportPlugin::add_ios_bundle_file);
ClassDB::bind_method(D_METHOD("add_ios_cpp_code", "code"), &EditorExportPlugin::add_ios_cpp_code);
ClassDB::bind_method(D_METHOD("add_osx_plugin_file", "path"), &EditorExportPlugin::add_osx_plugin_file);
ClassDB::bind_method(D_METHOD("add_macos_plugin_file", "path"), &EditorExportPlugin::add_macos_plugin_file);
ClassDB::bind_method(D_METHOD("skip"), &EditorExportPlugin::skip);

GDVIRTUAL_BIND(_export_file, "path", "type", "features");
Expand Down
8 changes: 4 additions & 4 deletions editor/editor_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class EditorExportPlugin : public RefCounted {
Vector<String> ios_bundle_files;
String ios_cpp_code;

Vector<String> osx_plugin_files;
Vector<String> macos_plugin_files;

_FORCE_INLINE_ void _clear() {
shared_objects.clear();
Expand All @@ -381,7 +381,7 @@ class EditorExportPlugin : public RefCounted {
ios_plist_content = "";
ios_linker_flags = "";
ios_cpp_code = "";
osx_plugin_files.clear();
macos_plugin_files.clear();
}

void _export_file_script(const String &p_path, const String &p_type, const Vector<String> &p_features);
Expand All @@ -402,7 +402,7 @@ class EditorExportPlugin : public RefCounted {
void add_ios_linker_flags(const String &p_flags);
void add_ios_bundle_file(const String &p_path);
void add_ios_cpp_code(const String &p_code);
void add_osx_plugin_file(const String &p_path);
void add_macos_plugin_file(const String &p_path);

void skip();

Expand All @@ -423,7 +423,7 @@ class EditorExportPlugin : public RefCounted {
String get_ios_linker_flags() const;
Vector<String> get_ios_bundle_files() const;
String get_ios_cpp_code() const;
const Vector<String> &get_osx_plugin_files() const;
const Vector<String> &get_macos_plugin_files() const;

EditorExportPlugin();
};
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_fonts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
// - macOS doesn't use font hinting.
// - Windows uses ClearType, which is in between "Light" and "Normal" hinting.
// - Linux has configurable font hinting, but most distributions including Ubuntu default to "Light".
#ifdef OSX_ENABLED
#ifdef MACOS_ENABLED
font_hinting = TextServer::HINTING_NONE;
#else
font_hinting = TextServer::HINTING_LIGHT;
Expand Down
Loading

0 comments on commit a9e4eac

Please sign in to comment.