Skip to content

Commit

Permalink
Merge pull request #790 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 8772a7f + 0ee980a commit a0b6203
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:

- name: 🍎 macOS (universal)
os: macos-11
platform: osx
platform: macos
artifact-name: godot-cpp-macos-universal-release
artifact-path: bin/libgodot-cpp.osx.release.universal.a
artifact-path: bin/libgodot-cpp.macos.release.universal.a
flags: arch=universal

- name: 🤖 Android (arm64)
Expand Down
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ USE_CLANG = no
BASE = scons use_llvm=$(USE_CLANG) generate_bindings=$(GENERATE_BINDINGS) target=$(TARGET) headers=$(HEADERS)
LINUX = $(BASE) platform=linux
WINDOWS = $(BASE) platform=windows
OSX = $(BASE) platform=osx
MACOS = $(BASE) platform=macos


all:
Expand Down Expand Up @@ -36,12 +36,5 @@ windows64: SConstruct
$(WINDOWS) bits=64


osx:
make osx32
make osx64

osx32: SConstruct
$(OSX) bits=32

osx64: SConstruct
$(OSX) bits=64
macos: SConstruct
$(MACOS)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ entry_symbol = "example_library_init"

[libraries]

macos.debug = "bin/libgdexample.osx.debug.framework"
macos.release = "bin/libgdexample.osx.release.framework"
macos.debug = "bin/libgdexample.macos.debug.framework"
macos.release = "bin/libgdexample.macos.release.framework"
windows.debug.x86_64 = "bin/libgdexample.windows.debug.x86_64.dll"
windows.release.x86_64 = "bin/libgdexample.windows.release.x86_64.dll"
linux.debug.x86_64 = "bin/libgdexample.linux.debug.x86_64.so"
Expand Down
6 changes: 3 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def add_sources(sources, dir, extension):
if sys.platform.startswith("linux"):
default_platform = "linux"
elif sys.platform == "darwin":
default_platform = "osx"
default_platform = "macos"
elif sys.platform == "win32" or sys.platform == "msys":
default_platform = "windows"
elif ARGUMENTS.get("platform", ""):
Expand Down Expand Up @@ -48,7 +48,7 @@ if env.GetOption("num_jobs") == altered_num_jobs:
)
env.SetOption("num_jobs", safer_cpu_count)

platforms = ("linux", "osx", "windows", "android", "ios", "javascript")
platforms = ("linux", "macos", "windows", "android", "ios", "javascript")
opts = Variables([], ARGUMENTS)
opts.Add(
EnumVariable(
Expand Down Expand Up @@ -110,7 +110,7 @@ if env["arch"] == "":
# No architecture specified. Default to arm64 if building for Android,
# universal if building for macOS or iOS, wasm32 if building for web,
# otherwise default to the host architecture.
if env["platform"] in ["osx", "ios"]:
if env["platform"] in ["macos", "ios"]:
env["arch"] = "universal"
elif env["platform"] == "android":
env["arch"] = "arm64"
Expand Down
2 changes: 1 addition & 1 deletion godot-headers/extension_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -76305,7 +76305,7 @@
]
},
{
"name": "add_osx_plugin_file",
"name": "add_macos_plugin_file",
"is_const": false,
"is_vararg": false,
"is_static": false,
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(TARGET_PATH win64)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(TARGET_PATH osx)
set(TARGET_PATH macos)
else()
message(FATAL_ERROR "Not implemented support for ${CMAKE_SYSTEM_NAME}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion test/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env = SConscript("../SConstruct")
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")

if env["platform"] == "osx":
if env["platform"] == "macos":
library = env.SharedLibrary(
"demo/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
Expand Down
4 changes: 2 additions & 2 deletions test/demo/example.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ entry_symbol = "example_library_init"

[libraries]

macos.debug = "bin/libgdexample.osx.debug.framework"
macos.release = "bin/libgdexample.osx.release.framework"
macos.debug = "bin/libgdexample.macos.debug.framework"
macos.release = "bin/libgdexample.macos.release.framework"
windows.debug.x86_32 = "bin/libgdexample.windows.debug.x86_32.dll"
windows.release.x86_32 = "bin/libgdexample.windows.release.x86_32.dll"
windows.debug.x86_64 = "bin/libgdexample.windows.debug.x86_64.dll"
Expand Down
18 changes: 9 additions & 9 deletions tools/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def options(opts):
opts.Add(BoolVariable("ios_simulator", "Target iOS Simulator", False))
opts.Add("ios_min_version", "Target minimum iphoneos/iphonesimulator version", "10.0")
opts.Add(
"IPHONEPATH",
"Path to iPhone toolchain",
"IOS_TOOLCHAIN_PATH",
"Path to iOS toolchain",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain",
)
opts.Add("IPHONESDK", "Path to the iPhone SDK", "")
opts.Add("IOS_SDK_PATH", "Path to the iOS SDK", "")
ios_osxcross.options(opts)


Expand All @@ -45,23 +45,23 @@ def generate(env):
env.Append(CCFLAGS=["-miphoneos-version-min=" + env["ios_min_version"]])

if sys.platform == "darwin":
if env["IPHONESDK"] == "":
if env["IOS_SDK_PATH"] == "":
try:
env["IPHONESDK"] = decode_utf8(
env["IOS_SDK_PATH"] = decode_utf8(
subprocess.check_output(["xcrun", "--sdk", sdk_name, "--show-sdk-path"]).strip()
)
except (subprocess.CalledProcessError, OSError):
raise ValueError(
"Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name)
)

compiler_path = env["IPHONEPATH"] + "/usr/bin/"
compiler_path = env["IOS_TOOLCHAIN_PATH"] + "/usr/bin/"
env["CC"] = compiler_path + "clang"
env["CXX"] = compiler_path + "clang++"
env["AR"] = compiler_path + "ar"
env["RANLIB"] = compiler_path + "ranlib"
env["SHLIBSUFFIX"] = ".dylib"
env["ENV"]["PATH"] = env["IPHONEPATH"] + "/Developer/usr/bin/:" + env["ENV"]["PATH"]
env["ENV"]["PATH"] = env["IOS_TOOLCHAIN_PATH"] + "/Developer/usr/bin/:" + env["ENV"]["PATH"]

else:
ios_osxcross.generate(env)
Expand All @@ -77,8 +77,8 @@ def generate(env):
env.Append(LINKFLAGS=["-arch", env["arch"]])
env.Append(CCFLAGS=["-arch", env["arch"]])

env.Append(CCFLAGS=["-isysroot", env["IPHONESDK"]])
env.Append(LINKFLAGS=["-isysroot", env["IPHONESDK"], "-F" + env["IPHONESDK"]])
env.Append(CCFLAGS=["-isysroot", env["IOS_SDK_PATH"]])
env.Append(LINKFLAGS=["-isysroot", env["IOS_SDK_PATH"], "-F" + env["IOS_SDK_PATH"]])

if env["target"] == "debug":
env.Append(CCFLAGS=["-Og", "-g"])
Expand Down
6 changes: 3 additions & 3 deletions tools/ios_osxcross.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def exists(env):


def generate(env):
compiler_path = "$IPHONEPATH/usr/bin/${ios_triple}"
compiler_path = "$IOS_TOOLCHAIN_PATH/usr/bin/${ios_triple}"
env["CC"] = compiler_path + "clang"
env["CXX"] = compiler_path + "clang++"
env["AR"] = compiler_path + "ar"
Expand All @@ -19,8 +19,8 @@ def generate(env):

env.Prepend(
CPPPATH=[
"$IPHONESDK/usr/include",
"$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers",
"$IOS_SDK_PATH/usr/include",
"$IOS_SDK_PATH/System/Library/Frameworks/AudioUnit.framework/Headers",
]
)
env.Append(CCFLAGS=["-stdlib=libc++"])
8 changes: 4 additions & 4 deletions tools/osx.py → tools/macos.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import os
import sys
import osxcross
import macos_osxcross


def options(opts):
opts.Add("macos_deployment_target", "macOS deployment target", "default")
opts.Add("macos_sdk_path", "macOS SDK path", "")
osxcross.options(opts)
macos_osxcross.options(opts)


def exists(env):
return sys.platform == "darwin" or osxcross.exists(env)
return sys.platform == "darwin" or macos_osxcross.exists(env)


def generate(env):
Expand All @@ -24,7 +24,7 @@ def generate(env):
env["CC"] = "clang"
else:
# Use osxcross
osxcross.generate(env)
macos_osxcross.generate(env)

if env["arch"] == "universal":
env.Append(LINKFLAGS=["-arch", "x86_64", "-arch", "arm64"])
Expand Down
File renamed without changes.

0 comments on commit a0b6203

Please sign in to comment.