Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling MacOS build #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void ActivateController(InputWrapper wrapper, int controllerIndex, IContr

if (Utility.CheckXInputSupport() && wrapper == InputWrapper.XInput)
{
#if !LINUX
#if !LINUX && !OSX
controller.iface = new XInputController(controller.controllerIndex);
#endif
}
Expand Down Expand Up @@ -184,7 +184,7 @@ public void OnPostDeserialize()
{
if (Utility.CheckXInputSupport() && config.wrapper == InputWrapper.XInput)
{
#if !LINUX
#if !LINUX && !OSX
config.iface = new XInputController(config.controllerIndex);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions DefaultControllerPresets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static List<ControllerPreset> GetDefaultPresets(IController controller)
{
List<ControllerPreset> presets = new List<ControllerPreset>();

#if !LINUX
#if !LINUX && !OSX
if (Utility.CheckXInputSupport() && controller is XInputController)
{
presets.Add(GetXInputDefaultRocketPreset(controller));
Expand All @@ -26,7 +26,7 @@ public static ControllerPreset GetXInputDefaultRocketPreset(IController controll
ControllerPreset preset = new ControllerPreset();
preset.name = "XInput Default";

#if !LINUX
#if !LINUX && !OSX
int buttonsCount = controller.GetButtonsCount();

preset.SetDiscreteBinding(new Bitset(buttonsCount, (int)XInput.Button.DPadLeft), DiscreteAction.SAS);
Expand Down
2 changes: 1 addition & 1 deletion IController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static List<KeyValuePair<InputWrapper, KeyValuePair<int, string>>> Enumer

if (Utility.CheckXInputSupport())
{
#if !LINUX
#if !LINUX && !OSX
foreach (var controllerName in XInputController.EnumerateControllers())
{
controllers.Add(new KeyValuePair<InputWrapper, KeyValuePair<int, string>>(InputWrapper.XInput, controllerName));
Expand Down
4 changes: 3 additions & 1 deletion SDL2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public static class SDL

#if LINUX
private const string nativeLibName = "libSDL2-2.0.so.0";
#elif OSX
private const string nativeLibName = "libSDL2-2.0.0.dylib";
#else
private const string nativeLibName = "SDL2.dll";
#endif
Expand Down Expand Up @@ -5639,4 +5641,4 @@ string app

#endregion
}
}
}
4 changes: 2 additions & 2 deletions Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static Rect ClampRect(Rect rect, Rect container)

public static bool CheckXInputSupport()
{
#if LINUX
#if LINUX || OSX
return false;
#else
return true;
Expand All @@ -73,7 +73,7 @@ public static bool CheckSDLSupport()

public static bool CheckSharpDXSupport()
{
#if LINUX
#if LINUX || OSX
return false;
#else
return true;
Expand Down
155 changes: 155 additions & 0 deletions ksp-advanced-flybywire-osx.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C4BAF0C4-E0D3-4246-9CC0-2DE5B6E962FD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KSPAdvancedFlyByWire</RootNamespace>
<AssemblyName>ksp-advanced-flybywire</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;OSX</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>LINUX</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>LINUX</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Compile Include="AxisConfiguration.cs" />
<Compile Include="Bitset.cs" />
<Compile Include="CameraController.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="ControllerPreset.cs" />
<Compile Include="ControllerConfigurationWindow.cs" />
<Compile Include="DefaultControllerPresets.cs" />
<Compile Include="EVAController.cs" />
<Compile Include="FlightManager.cs" />
<Compile Include="FlightProperty.cs" />
<Compile Include="KeyboardMouseController.cs" />
<Compile Include="ModSettingsWindow.cs" />
<Compile Include="PresetEditorWindow.cs" />
<Compile Include="PresetEditorWindowNG.cs" />
<Compile Include="SDL2.cs" />
<Compile Include="SDLController.cs" />
<Compile Include="Stringify.cs" />
<Compile Include="StringMarshaller.cs" />
<Compile Include="Utility.cs" />
<Compile Include="WarpController.cs" />
<Compile Include="EvaluationCurves.cs" />
<Compile Include="AdvancedFlyByWire.cs" />
<Compile Include="IController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-UnityScript">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\Assembly-UnityScript.dll</HintPath>
</Reference>
<Reference Include="Assembly-UnityScript-firstpass">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\Assembly-UnityScript-firstpass.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="System.Core">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\System.Core.dll</HintPath>
</Reference>
<Reference Include="System">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\System.dll</HintPath>
</Reference>
<Reference Include="System.Xml">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\System.Xml.dll</HintPath>
</Reference>
<Reference Include="aaa_Toolbar">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\GameData\000_Toolbar\Plugins\aaa_Toolbar.dll</HintPath>
</Reference>
<Reference Include="mscorlib">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\mscorlib.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\Library\Application Support\Steam\steamapps\common\Kerbal Space Program\KSP.app\Contents\Resources\Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /Y ksp-advanced-flybywire.dll ..\..\builds\osx\GameData\ksp-advanced-flybywire\
xcopy /Y ksp-advanced-flybywire.dll ..\..\builds\alpha\osx\
rmdir /S /q ..\..\obj\
xcopy /Y ksp-advanced-flybywire.dll "$(KSP_PATH)GameData\ksp-advanced-flybywire\"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>