From 210f6e7f0d44b199f303182367597f05cefe48f2 Mon Sep 17 00:00:00 2001 From: Skyler Saleh Date: Sun, 23 May 2021 20:33:39 -0700 Subject: [PATCH] Apple M1: Update AutoUpdate PlatformID Adds a new PlatformID for universal builds. This will allow single architecture builds to be updated through the single architecture path, and universal builds to be updated with universal builds. --- BuildMacOSUniversalBinary.py | 6 ++++-- Source/Core/UICommon/AutoUpdate.cpp | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BuildMacOSUniversalBinary.py b/BuildMacOSUniversalBinary.py index 5ed4808bfd..ea6f83d077 100755 --- a/BuildMacOSUniversalBinary.py +++ b/BuildMacOSUniversalBinary.py @@ -171,7 +171,7 @@ def recursive_merge_binaries(src0, src1, dst): continue if os.path.islink(newpath0) and os.path.islink(newpath1): - if os.path.relpath(newpath0,src0) == os.path.relpath(newpath1,src1): + if os.path.relpath(newpath0, src0) == os.path.relpath(newpath1, src1): continue if os.path.isdir(newpath0) and os.path.isdir(newpath1): @@ -201,7 +201,7 @@ def recursive_merge_binaries(src0, src1, dst): shutil.copytree(newpath0, new_dst_path) else: shutil.copy(newpath0, new_dst_path) - + continue if os.path.isdir(newpath1): @@ -271,6 +271,8 @@ def build(config): subprocess.check_call([ "cmake", "../../", "-G", config["generator"], "-DCMAKE_BUILD_TYPE=" + config["build_type"], + '-DCMAKE_CXX_FLAGS="-DMACOS_UNIVERSAL_BUILD=1"', + '-DCMAKE_C_FLAGS="-DMACOS_UNIVERSAL_BUILD=1"', # System name needs to be specified for CMake to use # the specified CMAKE_SYSTEM_PROCESSOR "-DCMAKE_SYSTEM_NAME=Darwin", diff --git a/Source/Core/UICommon/AutoUpdate.cpp b/Source/Core/UICommon/AutoUpdate.cpp index 0a5ad10c40..5808d3ac2e 100644 --- a/Source/Core/UICommon/AutoUpdate.cpp +++ b/Source/Core/UICommon/AutoUpdate.cpp @@ -140,7 +140,11 @@ static std::string GetPlatformID() #if defined _WIN32 return "win"; #elif defined __APPLE__ +#if defined(MACOS_UNIVERSAL_BUILD) + return "macos-universal"; +#else return "macos"; +#endif #else return "unknown"; #endif