diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libGenericCodeGen.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libGenericCodeGen.a new file mode 100644 index 000000000..b926a937e --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libGenericCodeGen.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0115536b7188af69c7125b92886ca77a04e23aec240ee9bb47731df579ff8c94 +size 11672 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libHLSL.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libHLSL.a new file mode 100644 index 000000000..c735cf5ea --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libHLSL.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e40cf2c8f5dce7763f1c09fcee454d3fb6b312c954e175bfbd1caf664136213 +size 496 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a new file mode 100644 index 000000000..6bcd58a96 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libIrrXML.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6aa0849de08ac7f7332c63941b6ed028c329971b7d0ce9de44580e46b7560f2d +size 519048 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libMachineIndependent.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libMachineIndependent.a new file mode 100644 index 000000000..bc8024197 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libMachineIndependent.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f32c3476df04dde228b42f1cd7e26af6a724a1de58601c310ccd01ed9624f4a2 +size 3240520 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libOGLCompiler.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libOGLCompiler.a new file mode 100644 index 000000000..61d8157d6 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libOGLCompiler.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e4945e2f608c5a5197de0df5cbc0f291d819d2085f40f1b1a7c9ddb7a0d56f5 +size 2072 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libOSDependent.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libOSDependent.a new file mode 100644 index 000000000..64a321f39 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libOSDependent.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23680a612b619e436e94c120474389093bca5f8d4322414f94f43aed8a7de72c +size 2912 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV-Tools-opt.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV-Tools-opt.a new file mode 100644 index 000000000..5d7781897 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV-Tools-opt.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:445b4b289982a7eb26eff14c8dca8349308b9a382f478de3cbe0a7bfa821ef7c +size 5320568 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV-Tools.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV-Tools.a new file mode 100644 index 000000000..2fa7106dc --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV-Tools.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:468aa044894e9e79199dd0fc24d88f2e26d2e958eebfeaafe0f757a763089048 +size 2059768 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV.a new file mode 100644 index 000000000..77fc416f3 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libSPIRV.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:831f77515304bc22e2e7d4e9e6ac9f2ecaada062d3cbe28806b3166a2caeac91 +size 701864 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a new file mode 100644 index 000000000..622b54e48 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libassimp.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05ed7fbba9701903c4d488eebda74ff71316af984bda5b125ff4822e53c05f3a +size 66547240 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libcurl.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libcurl.a new file mode 100644 index 000000000..55ced1e45 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libcurl.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43793fb70a86f66e74f1dff9a0ae7d86089722ca3681189972e8e209756845f2 +size 489872 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libfreetype.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libfreetype.a new file mode 100644 index 000000000..e31bd6708 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libfreetype.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0da8c77495ea68ee3a2b79cb51ee11910821645e2403a75fe3bc962dad7c63f3 +size 887200 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libglslang.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libglslang.a new file mode 100644 index 000000000..7e88c80ce --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libglslang.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59b13c4642da4bf6ee20647fafaaa0aa1fdce34a5f58ec92822974f28fcc100b +size 24368 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libogg.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libogg.a new file mode 100644 index 000000000..ed83ad02b --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libogg.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:793df4efc051d1f7b84cf091187f6664c6c1b573c0b9ae7d9d1e17bff40d849b +size 22504 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libopenal.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libopenal.a new file mode 100644 index 000000000..50e16252f --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libopenal.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b94c2ea831342ad274ec95aba3161dceba1334d36a6d620ec015e9f26170bc58 +size 1133976 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbis.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbis.a new file mode 100644 index 000000000..534706c4f --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbis.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3fdf83d67105870b4143a7e2411994fe937d1476646bc31ffe82f066a007a30 +size 222048 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbisenc.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbisenc.a new file mode 100644 index 000000000..70313d8d1 --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbisenc.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:871c3d05c5803553b7b80d2f5e1619daa388cf2763d1bc21adbd5daa2097cb4a +size 688272 diff --git a/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbisfile.a b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbisfile.a new file mode 100644 index 000000000..b716bc0ec --- /dev/null +++ b/Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libvorbisfile.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:882d43670bbfdef7a1c12ca103ab6db89ea7e256dec22e24dd9e3a523c0cab70 +size 30608 diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs index d135a6c56..528256f69 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/Assimp.cs @@ -128,11 +128,14 @@ namespace Flax.Deps.Dependencies case TargetPlatform.Mac: { // Build for Mac - RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig); - Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); - Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) + { + RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig); + Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a")); + Utilities.FileCopy(Path.Combine(root, "lib", "libIrrXML.a"), Path.Combine(depsFolder, "libIrrXML.a")); + } break; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs b/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs index 8fe11bca3..eaf9e7e75 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs @@ -169,14 +169,17 @@ namespace Flax.Deps.Dependencies // Use separate build directory root = Path.Combine(root, "openal-soft-" + version); var buildDir = Path.Combine(root, "build"); - SetupDirectory(buildDir, true); // Build for Mac - RunCmake(buildDir, platform, TargetArchitecture.x64, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=Release " + config); - Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - foreach (var file in binariesToCopy) - Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file)); + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) + { + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, architecture, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=Release " + config); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + foreach (var file in binariesToCopy) + Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file)); + } break; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/curl.cs b/Source/Tools/Flax.Build/Deps/Dependencies/curl.cs index cb1bcdbcb..382c5707c 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/curl.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/curl.cs @@ -63,9 +63,10 @@ namespace Flax.Deps.Dependencies Downloader.DownloadFileFromUrlToPath("https://curl.haxx.se/download/curl-7.64.1.zip", packagePath); using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read)) { - if (!Directory.Exists(root)) + var newRoot = Path.Combine(root, archive.Entries.First().FullName); + if (!Directory.Exists(newRoot)) archive.ExtractToDirectory(root); - root = Path.Combine(root, archive.Entries.First().FullName); + root = newRoot; } foreach (var platform in options.Platforms) @@ -114,7 +115,7 @@ namespace Flax.Deps.Dependencies var buildDir = Path.Combine(root, "build"); SetupDirectory(buildDir, true); Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError); - Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.None, envVars); + Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars); Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError); var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); @@ -136,28 +137,35 @@ namespace Flax.Deps.Dependencies "--enable-static", "-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb", }; - var arch = "x86_64"; - var archName = arch + "-apple-darwin18"; - var compilerFlags = string.Format("-mmacosx-version-min={0} -arch {1}", Configuration.MacOSXMinVer, arch); - var envVars = new Dictionary + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) { - { "CFLAGS", compilerFlags }, - { "CXXFLAGS", compilerFlags }, - { "CPPFLAGS", compilerFlags }, - { "ARCH", arch }, - { "SDK", "macosx" }, - { "DEPLOYMENT_TARGET", Configuration.MacOSXMinVer }, - }; - var buildDir = Path.Combine(root, "build"); - SetupDirectory(buildDir, true); - Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError); - Utilities.Run("chmod", "+x install-sh", null, root, Utilities.RunOptions.ThrowExceptionOnError); - Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --host=" + archName + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.None, envVars); - Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); - Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - var filename = "libcurl.a"; - Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename)); + var arch = GetAppleArchName(architecture); + var archName = arch + "-apple-darwin19"; + if (architecture == TargetArchitecture.ARM64) + archName = "arm-apple-darwin19"; // for configure + var compilerFlags = string.Format("-mmacosx-version-min={0} -arch {1}", Configuration.MacOSXMinVer, arch); + var envVars = new Dictionary + { + { "CC", "clang" }, + { "CXX", "clang" }, + { "CFLAGS", compilerFlags }, + { "CXXFLAGS", compilerFlags }, + { "CPPFLAGS", compilerFlags }, + { "ARCH", arch }, + { "SDK", "macosx" }, + { "DEPLOYMENT_TARGET", Configuration.MacOSXMinVer }, + }; + var buildDir = Path.Combine(root, "build"); + SetupDirectory(buildDir, true); + Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError); + Utilities.Run("chmod", "+x install-sh", null, root, Utilities.RunOptions.ThrowExceptionOnError); + Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --host=" + archName + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars); + Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError); + Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + var filename = "libcurl.a"; + Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename)); + } break; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs b/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs index 5984053cb..939534f85 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs @@ -72,9 +72,10 @@ namespace Flax.Deps.Dependencies Downloader.DownloadFileFromUrlToPath("https://sourceforge.net/projects/freetype/files/freetype2/2.10.0/ft2100.zip/download", packagePath); using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read)) { - if (!Directory.Exists(root)) + var newRoot = Path.Combine(root, archive.Entries.First().FullName); + if (!Directory.Exists(newRoot)) archive.ExtractToDirectory(root); - root = Path.Combine(root, archive.Entries.First().FullName); + root = newRoot; } var configurationMsvc = "Release Static"; @@ -249,11 +250,14 @@ namespace Flax.Deps.Dependencies { // Build for Mac var buildDir = Path.Combine(root, "build"); - SetupDirectory(buildDir, true); - RunCmake(buildDir, platform, TargetArchitecture.x64, ".. -DCMAKE_BUILD_TYPE=Release"); - Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName)); + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) + { + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release"); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName)); + } break; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/glslang.cs b/Source/Tools/Flax.Build/Deps/Dependencies/glslang.cs index b7cccbae2..f88ded6a1 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/glslang.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/glslang.cs @@ -130,15 +130,18 @@ namespace Flax.Deps.Dependencies }; // Build for Mac - RunCmake(root, platform, TargetArchitecture.x64, cmakeArgs); - Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.None); - Utilities.Run("make", null, null, root, Utilities.RunOptions.None); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - foreach (var file in outputFiles) + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) { - var dst = Path.Combine(depsFolder, Path.GetFileName(file)); - Utilities.FileCopy(file, dst); - Utilities.Run("strip", string.Format("\"{0}\"", dst), null, null, Utilities.RunOptions.None); + RunCmake(root, platform, architecture, cmakeArgs); + Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.None); + Utilities.Run("make", null, null, root, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + foreach (var file in outputFiles) + { + var dst = Path.Combine(depsFolder, Path.GetFileName(file)); + Utilities.FileCopy(file, dst); + Utilities.Run("strip", string.Format("\"{0}\"", dst), null, null, Utilities.RunOptions.None); + } } break; } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs b/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs index 7a6e9dde9..ddaf0e52e 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/mono.cs @@ -758,7 +758,7 @@ namespace Flax.Deps.Dependencies // Build mono SetupDirectory(buildDir, true); - var archName = "x86_64-apple-darwin18"; + var archName = "x86_64-apple-darwin19"; Utilities.Run(Path.Combine(root, "autogen.sh"), string.Format("--host={0} --prefix={1} {2}", archName, buildDir, string.Join(" ", monoOptions)), null, root, Utilities.RunOptions.None, envVars); Utilities.Run("make", null, null, root, Utilities.RunOptions.None, envVars); Utilities.Run("make", "install", null, root, Utilities.RunOptions.None, envVars); diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs b/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs index fd9621c25..1738e2247 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs @@ -221,11 +221,14 @@ namespace Flax.Deps.Dependencies var buildDir = Path.Combine(root, "build"); // Build for Mac - SetupDirectory(buildDir, true); - RunCmake(buildDir, platform, TargetArchitecture.x64, ".. -DCMAKE_BUILD_TYPE=Release"); - Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName)); + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) + { + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release"); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName)); + } break; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/vorbis.cs b/Source/Tools/Flax.Build/Deps/Dependencies/vorbis.cs index ca8c6f547..b82111229 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/vorbis.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/vorbis.cs @@ -374,16 +374,19 @@ namespace Flax.Deps.Dependencies CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git"); GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5"); - // Build for Android - SetupDirectory(oggBuildDir, true); - RunCmake(oggBuildDir, platform, TargetArchitecture.x64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\""); - Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.None); - SetupDirectory(buildDir, true); - RunCmake(buildDir, platform, TargetArchitecture.x64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot)); - Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); - var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64); - foreach (var file in binariesToCopyUnix) - Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename)); + // Build for Mac + foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) + { + SetupDirectory(oggBuildDir, true); + RunCmake(oggBuildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\""); + Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.None); + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, architecture, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot)); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, architecture); + foreach (var file in binariesToCopyUnix) + Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename)); + } break; } } diff --git a/Source/Tools/Flax.Build/Deps/Dependency.cs b/Source/Tools/Flax.Build/Deps/Dependency.cs index e52d932c4..f475040ee 100644 --- a/Source/Tools/Flax.Build/Deps/Dependency.cs +++ b/Source/Tools/Flax.Build/Deps/Dependency.cs @@ -270,7 +270,8 @@ namespace Flax.Deps } case TargetPlatform.Mac: { - cmdLine = string.Format("CMakeLists.txt -DCMAKE_OSX_DEPLOYMENT_TARGET=\"{0}\"", Configuration.MacOSXMinVer); + var arch = GetAppleArchName(architecture); + cmdLine = string.Format("CMakeLists.txt -DCMAKE_OSX_DEPLOYMENT_TARGET=\"{0}\" -DCMAKE_OSX_ARCHITECTURES={1}", Configuration.MacOSXMinVer, arch); break; } default: throw new InvalidPlatformException(platform); @@ -282,6 +283,31 @@ namespace Flax.Deps Utilities.Run("cmake", cmdLine, null, path, Utilities.RunOptions.None, envVars); } + /// + /// Gets the Apple architecture name (for toolchain). + /// + public static string GetAppleArchName(TargetArchitecture architecture) + { + string arch; + switch (architecture) + { + case TargetArchitecture.x86: + arch = "i386"; + break; + case TargetArchitecture.x64: + arch = "x86_64"; + break; + case TargetArchitecture.ARM: + arch = "arm"; + break; + case TargetArchitecture.ARM64: + arch = "arm64"; + break; + default: throw new InvalidArchitectureException(architecture); + } + return arch; + } + /// /// Runs the bash script via Cygwin tool (native bash on platforms other than Windows). /// diff --git a/Source/Tools/Flax.Build/Deps/Downloader.cs b/Source/Tools/Flax.Build/Deps/Downloader.cs index 73ca3b9b7..dcba01780 100644 --- a/Source/Tools/Flax.Build/Deps/Downloader.cs +++ b/Source/Tools/Flax.Build/Deps/Downloader.cs @@ -21,7 +21,7 @@ namespace Flax.Deps // Drive example: FileDownloader.DownloadFileFromURLToPath( "http://drive.google.com/file/d/FILEID/view?usp=sharing", @"C:\file.txt" ); public static FileInfo DownloadFileFromUrlToPath(string url, string path) { - Log.Verbose(string.Format("Downloading {0} to {1}", url, path)); + Log.Info(string.Format("Downloading {0} to {1}", url, path)); if (File.Exists(path)) File.Delete(path); if (url.StartsWith(GoogleDriveDomain) || url.StartsWith(GoogleDriveDomain2))