Merge pull request #790 from bruvzg/mac_rename

pull/794/head
Rémi Verschelde 2022-07-21 10:25:43 +02:00 committed by GitHub
commit a0b6203854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 31 additions and 38 deletions

View File

@ -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)

View File

@ -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:
@ -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)

View File

@ -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"

View File

@ -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", ""):
@ -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(
@ -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"

View File

@ -76305,7 +76305,7 @@
]
},
{
"name": "add_osx_plugin_file",
"name": "add_macos_plugin_file",
"is_const": false,
"is_vararg": false,
"is_static": false,

View File

@ -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()

View File

@ -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"]

View File

@ -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"

View File

@ -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)
@ -45,9 +45,9 @@ 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):
@ -55,13 +55,13 @@ def generate(env):
"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)
@ -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"])

View File

@ -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"
@ -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++"])

View File

@ -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):
@ -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"])