diff --git a/Source/Engine/Audio/Audio.Build.cs b/Source/Engine/Audio/Audio.Build.cs index 1b0b04514..8994abe02 100644 --- a/Source/Engine/Audio/Audio.Build.cs +++ b/Source/Engine/Audio/Audio.Build.cs @@ -55,9 +55,11 @@ public class Audio : EngineModule options.CompileEnv.PreprocessorDefinitions.Add("AUDIO_API_PS5"); break; case TargetPlatform.Mac: - case TargetPlatform.iOS: useOpenAL = true; break; + case TargetPlatform.iOS: + //useOpenAL = true; // TODO: fix linker error 'ld: framework not found AudioUnit' for OpenAL on iOS + break; default: throw new InvalidPlatformException(options.Platform.Target); } diff --git a/Source/Platforms/iOS/.gitignore b/Source/Platforms/iOS/.gitignore new file mode 100644 index 000000000..00be8b280 --- /dev/null +++ b/Source/Platforms/iOS/.gitignore @@ -0,0 +1,4 @@ +!Binaries/ +!bin/ +!*.* +*.DS_Store diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCharacterKinematic_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCharacterKinematic_static_64.a new file mode 100644 index 000000000..12b08f70a --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCharacterKinematic_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd561fb2705fae1b2be8e512a7ac6dab3bf8ccea3bc5aedb7fac948c27f8fcfe +size 2605680 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCommon_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCommon_static_64.a new file mode 100644 index 000000000..db887da54 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCommon_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81bf0217e8297a347acfb3a09735404be2d4174ac9d0d83d1bfea906b3d8080c +size 31913888 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCooking_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCooking_static_64.a new file mode 100644 index 000000000..3711aafa0 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXCooking_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd96d96cea66cd2ff741d60c4caa575d3280fa74cb37c07eb0d44ba67af4d588 +size 170336 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXExtensions_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXExtensions_static_64.a new file mode 100644 index 000000000..736668633 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXExtensions_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62ace9a29db1bca74b7aadfc052d6781de064bee2e010bbd66c1219c11be09be +size 23526544 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXFoundation_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXFoundation_static_64.a new file mode 100644 index 000000000..64a801aed --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXFoundation_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:365aa50d42fdf84876ff592555021997f176d02396537d24ef07990e13815884 +size 388024 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXPvdSDK_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXPvdSDK_static_64.a new file mode 100644 index 000000000..a967eeba7 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXPvdSDK_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:816451b0e172c9da826f8f3a13222fc4002d4e3be829f3ee53718e414809aa22 +size 2223872 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXVehicle2_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXVehicle2_static_64.a new file mode 100644 index 000000000..d23bda07f --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXVehicle2_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ff5590dc366cba414b79d1d31914fd8c560db3da776083d9d084148d93730fa +size 1567040 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXVehicle_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXVehicle_static_64.a new file mode 100644 index 000000000..690a92a3f --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysXVehicle_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ffb1bb6bec2b8dc54e7fe85c0a5011f0bbe99cc78f4fd7e447469d846b9ec5ff +size 7709616 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysX_static_64.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysX_static_64.a new file mode 100644 index 000000000..bc385f3d4 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libPhysX_static_64.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37df05e01ae2cbe7717405abbaf33aa450d727c38b32344fe4b944b52da7485b +size 90307560 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libfreetype.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libfreetype.a new file mode 100644 index 000000000..d326f20f7 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libfreetype.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a39d6f75ce78e2dde2202cc7cb0d90b078a844e4ee33a4d0e0ba636f7d06b345 +size 872136 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libogg.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libogg.a new file mode 100644 index 000000000..a5aeb5ecb --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libogg.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3b3fac0ddaa6c8f0fc3c95173258a78757ffe7cc3b755e19929f509df9d438a +size 22472 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libopenal.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libopenal.a new file mode 100644 index 000000000..e50f5c112 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libopenal.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22566cafc8a508056b8a50674cf8f214354bd8decb5c4aeba349c7c3de818207 +size 1500864 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbis.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbis.a new file mode 100644 index 000000000..7c8306024 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbis.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2843880d75939aeab6e9fb169b9c4e8e2ae1e9686e9643280dc3f5933911106e +size 222352 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbisenc.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbisenc.a new file mode 100644 index 000000000..e1bda95b4 --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbisenc.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91ff6bd6e0ddbb4daf54eb9b3f2d0aea8bea09c53dafd82694ef0eedfac6044e +size 688488 diff --git a/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbisfile.a b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbisfile.a new file mode 100644 index 000000000..d93e7267f --- /dev/null +++ b/Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libvorbisfile.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5ae3afb75aa4de8ce5f07b2a614ad05eaf870dca1bce641ce57950f673624e0 +size 29928 diff --git a/Source/ThirdParty/PhysX/PhysX.Build.cs b/Source/ThirdParty/PhysX/PhysX.Build.cs index ffd9035f5..104468f7d 100644 --- a/Source/ThirdParty/PhysX/PhysX.Build.cs +++ b/Source/ThirdParty/PhysX/PhysX.Build.cs @@ -60,6 +60,7 @@ public class PhysX : DepsModule case TargetPlatform.XboxScarlett: case TargetPlatform.Mac: case TargetPlatform.Android: + case TargetPlatform.iOS: switch (options.Architecture) { case TargetArchitecture.x86: diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs b/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs index eaf9e7e75..7ee0365ad 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/OpenAL.cs @@ -38,6 +38,7 @@ namespace Flax.Deps.Dependencies return new[] { TargetPlatform.Mac, + TargetPlatform.iOS, }; default: return new TargetPlatform[0]; } @@ -48,7 +49,7 @@ namespace Flax.Deps.Dependencies public override void Build(BuildOptions options) { var root = options.IntermediateFolder; - var version = "1.19.1"; + var version = "1.23.0"; var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "OpenAL"); foreach (var platform in options.Platforms) @@ -182,6 +183,35 @@ namespace Flax.Deps.Dependencies } break; } + case TargetPlatform.iOS: + { + var binariesToCopy = new[] + { + "libopenal.a", + }; + var config = "-DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES"; + + // Get the source + var packagePath = Path.Combine(root, "package.zip"); + if (!File.Exists(packagePath)) + { + Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath); + Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.None); + } + + // Use separate build directory + root = Path.Combine(root, "openal-soft-" + version); + var buildDir = Path.Combine(root, "build"); + + // Build for iOS + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_SYSTEM_NAME=iOS -DALSOFT_OSX_FRAMEWORK=ON -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=Release " + config); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64); + 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/PhysX.cs b/Source/Tools/Flax.Build/Deps/Dependencies/PhysX.cs index 5c2bc938d..7f53d1e16 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/PhysX.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/PhysX.cs @@ -45,6 +45,7 @@ namespace Flax.Deps.Dependencies return new[] { TargetPlatform.Mac, + TargetPlatform.iOS, }; default: return new TargetPlatform[0]; } @@ -99,7 +100,10 @@ namespace Flax.Deps.Dependencies case TargetPlatform.Mac: ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.MacOSXMinVer); break; - // TODO: support CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET switch for iOS + case TargetPlatform.iOS: + ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.iOSMinVer); + ConfigureCmakeSwitch(cmakeParams, "CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET", Configuration.iOSMinVer); + break; } // Save preset @@ -202,7 +206,11 @@ namespace Flax.Deps.Dependencies binariesPrefix = "lib"; envVars.Add("MACOSX_DEPLOYMENT_TARGET", Configuration.MacOSXMinVer); break; - // TODO: set IPHONEOS_DEPLOYMENT_TARGET env var for iOS + case TargetPlatform.iOS: + binariesSubDir = "ios.arm_64"; + binariesPrefix = "lib"; + envVars.Add("IPHONEOS_DEPLOYMENT_TARGET", Configuration.iOSMinVer); + break; default: throw new InvalidPlatformException(targetPlatform); } @@ -410,6 +418,11 @@ namespace Flax.Deps.Dependencies Build(options, "mac-arm64", platform, TargetArchitecture.ARM64); break; } + case TargetPlatform.iOS: + { + Build(options, "ios64", platform, TargetArchitecture.ARM64); + break; + } } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs b/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs index 939534f85..165317180 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/freetype.cs @@ -43,6 +43,7 @@ namespace Flax.Deps.Dependencies return new[] { TargetPlatform.Mac, + TargetPlatform.iOS, }; default: return new TargetPlatform[0]; } @@ -77,6 +78,7 @@ namespace Flax.Deps.Dependencies archive.ExtractToDirectory(root); root = newRoot; } + var buildDir = Path.Combine(root, "build"); var configurationMsvc = "Release Static"; var binariesToCopyMsvc = new[] @@ -128,7 +130,6 @@ namespace Flax.Deps.Dependencies { "CC", "clang-7" }, { "CC_FOR_BUILD", "clang-7" } }; - var buildDir = Path.Combine(root, "build"); // Fix scripts Utilities.Run("sed", "-i -e \'s/\r$//\' autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars); @@ -216,8 +217,6 @@ namespace Flax.Deps.Dependencies } case TargetPlatform.Android: { - var buildDir = Path.Combine(root, "build"); - // Disable using libpng even if it's found on the system var cmakeFile = Path.Combine(root, "CMakeLists.txt"); File.WriteAllText(cmakeFile, @@ -238,7 +237,6 @@ namespace Flax.Deps.Dependencies case TargetPlatform.Switch: { // Build for Switch - var buildDir = Path.Combine(root, "build"); SetupDirectory(buildDir, true); RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release"); Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); @@ -249,7 +247,6 @@ namespace Flax.Deps.Dependencies case TargetPlatform.Mac: { // Build for Mac - var buildDir = Path.Combine(root, "build"); foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) { SetupDirectory(buildDir, true); @@ -260,6 +257,22 @@ namespace Flax.Deps.Dependencies } break; } + case TargetPlatform.iOS: + { + // Fix archive creation issue due to missing ar tool + Utilities.ReplaceInFile(Path.Combine(root, "builds/cmake/iOS.cmake"), "set(CMAKE_SYSTEM_NAME Darwin)", "set(CMAKE_SYSTEM_NAME Darwin)\nset(CMAKE_AR ar CACHE FILEPATH \"\" FORCE)"); + + // Fix freetype toolchain rejecting min iPhone version + Utilities.ReplaceInFile(Path.Combine(root, "builds/cmake/iOS.cmake"), "set(CMAKE_OSX_DEPLOYMENT_TARGET \"\"", "set(CMAKE_OSX_DEPLOYMENT_TARGET \"${CMAKE_OSX_DEPLOYMENT_TARGET}\""); + + // Build for iOS + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DIOS_PLATFORM=OS -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_BUILD_TYPE=Release -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF"); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64); + Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName)); + break; + } } } diff --git a/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs b/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs index 1738e2247..5c792cd6b 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/ogg.cs @@ -42,6 +42,7 @@ namespace Flax.Deps.Dependencies return new[] { TargetPlatform.Mac, + TargetPlatform.iOS, }; default: return new TargetPlatform[0]; } @@ -81,6 +82,7 @@ namespace Flax.Deps.Dependencies vcxprojContents = vcxprojContents.Replace("MultiThreaded", "MultiThreadedDLL"); vcxprojContents = vcxprojContents.Replace("MultiThreadedDebug", "MultiThreadedDebugDLL"); vcxprojContents = vcxprojContents.Replace("true", "false"); + var buildDir = Path.Combine(root, "build"); foreach (var platform in options.Platforms) { @@ -119,7 +121,6 @@ namespace Flax.Deps.Dependencies { "CC", "clang-7" }, { "CC_FOR_BUILD", "clang-7" } }; - var buildDir = Path.Combine(root, "build"); Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars); @@ -192,8 +193,6 @@ namespace Flax.Deps.Dependencies } case TargetPlatform.Android: { - var buildDir = Path.Combine(root, "build"); - // Build for Android SetupDirectory(buildDir, true); RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release"); @@ -208,7 +207,6 @@ namespace Flax.Deps.Dependencies Utilities.DirectoryCopy(Path.Combine(options.PlatformsFolder, "Switch", "Data", "ogg"), root, true, true); // Build for Switch - var buildDir = Path.Combine(root, "build"); SetupDirectory(buildDir, true); RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release"); Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); @@ -218,8 +216,6 @@ namespace Flax.Deps.Dependencies } case TargetPlatform.Mac: { - var buildDir = Path.Combine(root, "build"); - // Build for Mac foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 }) { @@ -231,6 +227,15 @@ namespace Flax.Deps.Dependencies } break; } + case TargetPlatform.iOS: + { + SetupDirectory(buildDir, true); + RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release"); + Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.None); + var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64); + 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 b82111229..c491bf002 100644 --- a/Source/Tools/Flax.Build/Deps/Dependencies/vorbis.cs +++ b/Source/Tools/Flax.Build/Deps/Dependencies/vorbis.cs @@ -43,6 +43,7 @@ namespace Flax.Deps.Dependencies return new[] { TargetPlatform.Mac, + TargetPlatform.iOS, }; default: return new TargetPlatform[0]; } @@ -389,6 +390,29 @@ namespace Flax.Deps.Dependencies } break; } + case TargetPlatform.iOS: + { + var oggRoot = Path.Combine(root, "ogg"); + var oggBuildDir = Path.Combine(oggRoot, "build"); + var buildDir = Path.Combine(root, "build"); + + // Get the source + CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git"); + CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git"); + GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5"); + + // Build for Mac + SetupDirectory(oggBuildDir, true); + RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -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.ARM64, 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.ARM64); + 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 3b7f0bd9e..b0bec87ea 100644 --- a/Source/Tools/Flax.Build/Deps/Dependency.cs +++ b/Source/Tools/Flax.Build/Deps/Dependency.cs @@ -288,6 +288,12 @@ namespace Flax.Deps cmdLine = string.Format("CMakeLists.txt -DCMAKE_OSX_DEPLOYMENT_TARGET=\"{0}\" -DCMAKE_OSX_ARCHITECTURES={1}", Configuration.MacOSXMinVer, arch); break; } + case TargetPlatform.iOS: + { + var arch = GetAppleArchName(architecture); + cmdLine = string.Format("CMakeLists.txt -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_DEPLOYMENT_TARGET=\"{0}\" -DCMAKE_OSX_ARCHITECTURES={1}", Configuration.iOSMinVer, arch); + break; + } default: throw new InvalidPlatformException(platform); } diff --git a/Source/Tools/Flax.Build/Platforms/Apple/AppleToolchain.cs b/Source/Tools/Flax.Build/Platforms/Apple/AppleToolchain.cs index c0ff9f2a2..8d17a2d99 100644 --- a/Source/Tools/Flax.Build/Platforms/Apple/AppleToolchain.cs +++ b/Source/Tools/Flax.Build/Platforms/Apple/AppleToolchain.cs @@ -251,6 +251,7 @@ namespace Flax.Build.Platforms args.Add("-dynamiclib"); } } + SetupLinkFilesArgs(graph, options, args, outputFilePath); // Input libraries var libraryPaths = new HashSet(); diff --git a/Source/Tools/Flax.Build/Platforms/iOS/iOSToolchain.cs b/Source/Tools/Flax.Build/Platforms/iOS/iOSToolchain.cs index 9b83d803d..bee83f947 100644 --- a/Source/Tools/Flax.Build/Platforms/iOS/iOSToolchain.cs +++ b/Source/Tools/Flax.Build/Platforms/iOS/iOSToolchain.cs @@ -43,12 +43,16 @@ namespace Flax.Build.Platforms // TODO: move this to the specific module configs (eg. Platform.Build.cs) options.LinkEnv.InputLibraries.Add("z"); options.LinkEnv.InputLibraries.Add("bz2"); + options.LinkEnv.InputLibraries.Add("Foundation.framework"); options.LinkEnv.InputLibraries.Add("CoreFoundation.framework"); options.LinkEnv.InputLibraries.Add("CoreGraphics.framework"); options.LinkEnv.InputLibraries.Add("SystemConfiguration.framework"); options.LinkEnv.InputLibraries.Add("IOKit.framework"); options.LinkEnv.InputLibraries.Add("UIKit.framework"); options.LinkEnv.InputLibraries.Add("QuartzCore.framework"); + //options.LinkEnv.InputLibraries.Add("QuartzCore.framework"); + //options.LinkEnv.InputLibraries.Add("AudioToolbox.framework"); + //options.LinkEnv.InputLibraries.Add("AudioUnit.framework"); } protected override void AddArgsCommon(BuildOptions options, List args)