Add Mac platform
This commit is contained in:
60
Source/Tools/Flax.Build/Platforms/Mac/MacPlatform.cs
Normal file
60
Source/Tools/Flax.Build/Platforms/Mac/MacPlatform.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
||||
|
||||
using Flax.Build.Projects;
|
||||
|
||||
namespace Flax.Build.Platforms
|
||||
{
|
||||
/// <summary>
|
||||
/// The build platform for all Mac systems.
|
||||
/// </summary>
|
||||
/// <seealso cref="Platform" />
|
||||
public sealed class MacPlatform : Platform
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override TargetPlatform Target => TargetPlatform.Mac;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool HasRequiredSDKsInstalled { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool HasSharedLibrarySupport => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ExecutableFileExtension => string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string SharedLibraryFileExtension => ".dylib";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string StaticLibraryFileExtension => ".a";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ProgramDatabaseFileExtension => ".dSYM";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string SharedLibraryFilePrefix => string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string StaticLibraryFilePrefix => "lib";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override ProjectFormat DefaultProjectFormat => ProjectFormat.XCode;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Flax.Build.Platforms.MacPlatform"/> class.
|
||||
/// </summary>
|
||||
public MacPlatform()
|
||||
{
|
||||
if (Platform.BuildTargetPlatform != TargetPlatform.Mac)
|
||||
return;
|
||||
|
||||
throw new System.NotImplementedException("TODO: detect MacSDK installation");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override Toolchain CreateToolchain(TargetArchitecture architecture)
|
||||
{
|
||||
return new MacToolchain(this, architecture);
|
||||
}
|
||||
}
|
||||
}
|
||||
58
Source/Tools/Flax.Build/Platforms/Mac/MacToolchain.cs
Normal file
58
Source/Tools/Flax.Build/Platforms/Mac/MacToolchain.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Flax.Build.Graph;
|
||||
using Flax.Build.NativeCpp;
|
||||
|
||||
namespace Flax.Build.Platforms
|
||||
{
|
||||
/// <summary>
|
||||
/// The build toolchain for all Mac systems.
|
||||
/// </summary>
|
||||
/// <seealso cref="Toolchain" />
|
||||
public sealed class MacToolchain : Toolchain
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MacToolchain"/> class.
|
||||
/// </summary>
|
||||
/// <param name="platform">The platform.</param>
|
||||
/// <param name="architecture">The target architecture.</param>
|
||||
public MacToolchain(MacPlatform platform, TargetArchitecture architecture)
|
||||
: base(platform, architecture)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string DllExport => "__attribute__((__visibility__(\\\"default\\\")))";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string DllImport => "";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void LogInfo()
|
||||
{
|
||||
throw new NotImplementedException("TODO: MacToolchain.LogInfo");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void SetupEnvironment(BuildOptions options)
|
||||
{
|
||||
base.SetupEnvironment(options);
|
||||
|
||||
options.CompileEnv.PreprocessorDefinitions.Add("PLATFORM_MAC");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override CompileOutput CompileCppFiles(TaskGraph graph, BuildOptions options, List<string> sourceFiles, string outputPath)
|
||||
{
|
||||
throw new NotImplementedException("TODO: MacToolchain.CompileCppFiles");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void LinkFiles(TaskGraph graph, BuildOptions options, string outputFilePath)
|
||||
{
|
||||
throw new NotImplementedException("TODO: MacToolchain.LinkFiles");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user