Skip to content

Commit

Permalink
Apple M1: Update AutoUpdate PlatformID
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
skylersaleh committed May 24, 2021
1 parent abea411 commit 210f6e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BuildMacOSUniversalBinary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/UICommon/AutoUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 210f6e7

Please sign in to comment.