mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
macOS: Fix compilation scripts/errors for macOS
This commit is contained in:
parent
70404866e1
commit
9e83a29b93
20 changed files with 147 additions and 82 deletions
|
@ -968,14 +968,14 @@
|
|||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<CodeAnalysisRuleSet>Core.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>true</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
@ -983,7 +983,7 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
@ -991,7 +991,7 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
|
|
@ -62,7 +62,7 @@ bool StepBackManager::CheckStepBack()
|
|||
|
||||
if(clock < _targetClock && _targetClock - clock < _stateClockLimit) {
|
||||
//Create a save state every instruction for the last X clocks
|
||||
_cache.push_back({});
|
||||
_cache.push_back(StepBackCacheEntry());
|
||||
_cache.back().Clock = clock;
|
||||
_emu->Serialize(_cache.back().SaveState, true, 0);
|
||||
}
|
||||
|
|
|
@ -62,12 +62,6 @@ template<class T> NesPpu<T>::NesPpu(NesConsole* console)
|
|||
Reset();
|
||||
}
|
||||
|
||||
template<class T> NesPpu<T>::~NesPpu()
|
||||
{
|
||||
delete[] _outputBuffers[0];
|
||||
delete[] _outputBuffers[1];
|
||||
}
|
||||
|
||||
template<class T> void NesPpu<T>::Reset()
|
||||
{
|
||||
_masterClock = 0;
|
||||
|
|
|
@ -151,3 +151,9 @@ void NesPpu<T>::Run(uint64_t runTo)
|
|||
_masterClock += _masterClockDivider;
|
||||
} while(_masterClock + _masterClockDivider <= runTo);
|
||||
}
|
||||
|
||||
template<class T> NesPpu<T>::~NesPpu()
|
||||
{
|
||||
delete[] _outputBuffers[0];
|
||||
delete[] _outputBuffers[1];
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual ~NsfPpu() { }
|
||||
|
||||
void UpdateTimings(ConsoleRegion region, bool overclockAllowed) override
|
||||
{
|
||||
NesPpu<NsfPpu>::UpdateTimings(region, false);
|
||||
|
|
|
@ -1,16 +1,6 @@
|
|||
// pch.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#if _WIN32 || _WIN64
|
||||
#pragma comment(lib, "Core.lib")
|
||||
#pragma comment(lib, "Utilities.lib")
|
||||
#pragma comment(lib, "Windows.lib")
|
||||
#pragma comment(lib, "SevenZip.lib")
|
||||
#pragma comment(lib, "Lua.lib")
|
||||
#pragma comment(lib, "ws2_32.lib") //Winsock Library
|
||||
#define DllExport __declspec(dllexport)
|
||||
#else
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>MesenCore</TargetName>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
@ -79,7 +79,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>MesenCore</TargetName>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
@ -87,7 +87,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>MesenCore</TargetName>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
@ -95,7 +95,7 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>MesenCore</TargetName>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
@ -213,6 +213,23 @@
|
|||
<ClCompile Include="RecordApiWrapper.cpp" />
|
||||
<ClCompile Include="TestApiWrapper.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Core\Core.vcxproj">
|
||||
<Project>{78fef1a1-6df1-4cbb-a373-ae6fa7ce5ce0}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Lua\Lua.vcxproj">
|
||||
<Project>{b609e0a0-5050-4871-91d6-e760633bcdd1}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\SevenZip\SevenZip.vcxproj">
|
||||
<Project>{52c4ba3a-e699-4305-b23f-c9083fd07ab6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Utilities\Utilities.vcxproj">
|
||||
<Project>{b5330148-e8c7-46ba-b54e-69be59ea337d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Windows\Windows.vcxproj">
|
||||
<Project>{7761e790-b42c-4179-8550-8365ff9eb23e}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
|
|
@ -2,6 +2,13 @@
|
|||
#include "Core/Shared/Emulator.h"
|
||||
#include "Core/Shared/EmuSettings.h"
|
||||
#include "LinuxGameController.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
bool LinuxGameController::IsButtonPressed(int buttonNumber) { return 0; }
|
||||
int LinuxGameController::GetDeviceID() { return _deviceID; }
|
||||
bool LinuxGameController::IsDisconnected() { return _disconnected; }
|
||||
std::shared_ptr<LinuxGameController> LinuxGameController::GetController(Emulator* emu, int deviceID, bool logInformation) { return nullptr; }
|
||||
#else
|
||||
#include "libevdev/libevdev.h"
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
|
@ -229,3 +236,4 @@ static int print_event(struct input_event *ev)
|
|||
return 0;
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
|
|
@ -166,22 +166,22 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -70,25 +70,25 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -112,22 +112,22 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
xmlns:l="using:Mesen.Localization"
|
||||
xmlns:u="using:Mesen.Utilities"
|
||||
x:Class="Mesen.App"
|
||||
Name="Mesen"
|
||||
>
|
||||
<Application.Resources>
|
||||
<FontFamily x:Key="MesenFont">Microsoft Sans Serif</FontFamily>
|
||||
|
@ -50,4 +51,9 @@
|
|||
|
||||
<Application.Styles>
|
||||
</Application.Styles>
|
||||
|
||||
<NativeMenu.Menu>
|
||||
<NativeMenu>
|
||||
</NativeMenu>
|
||||
</NativeMenu.Menu>
|
||||
</Application>
|
||||
|
|
|
@ -126,16 +126,22 @@ namespace Mesen
|
|||
private static IntPtr DllImportResolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)
|
||||
{
|
||||
if(libraryName.Contains("Mesen") || libraryName.Contains("SkiaSharp") || libraryName.Contains("HarfBuzz")) {
|
||||
if(libraryName.EndsWith(".dll")) {
|
||||
libraryName = libraryName.Substring(0, libraryName.Length - 4);
|
||||
}
|
||||
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {
|
||||
if(!libraryName.StartsWith("lib")) {
|
||||
libraryName = "lib" + libraryName;
|
||||
}
|
||||
if(!libraryName.EndsWith(".so") && !libraryName.EndsWith(".dll")) {
|
||||
if(!libraryName.EndsWith(".so")) {
|
||||
libraryName = libraryName + ".so";
|
||||
}
|
||||
}
|
||||
if(!libraryName.EndsWith("dll") && RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||
libraryName = libraryName + ".dll";
|
||||
} else if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||
if(!libraryName.EndsWith(".dll")) {
|
||||
libraryName = libraryName + ".dll";
|
||||
}
|
||||
} else if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
if(!libraryName.EndsWith(".dylib")) {
|
||||
libraryName = libraryName + ".dylib";
|
||||
}
|
||||
}
|
||||
return NativeLibrary.Load(Path.Combine(ConfigManager.HomeFolder, libraryName));
|
||||
}
|
||||
|
|
21
UI/UI.csproj
21
UI/UI.csproj
|
@ -17,11 +17,14 @@
|
|||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)'=='osx-x64' Or '$(RuntimeIdentifier)'=='osx-arm64' Or '$(RuntimeIdentifier)'=='linux-x64'">
|
||||
<SolutionDir>..</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<OutputPath>$(SolutionDir)\bin\x64\Debug\</OutputPath>
|
||||
<OutputPath>$(SolutionDir)\bin\$(RuntimeIdentifier)\Debug\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<OutputPath>$(SolutionDir)\bin\x64\Release\</OutputPath>
|
||||
<OutputPath>$(SolutionDir)\bin\$(RuntimeIdentifier)\Release\</OutputPath>
|
||||
<Optimize>False</Optimize>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
@ -530,14 +533,16 @@
|
|||
<EmbeddedResource Include="Localization\resources.en.xml" WithCulture="false" Type="Non-Resx" />
|
||||
<EmbeddedResource Include="Utilities\DipSwitchDefinitions.xml" />
|
||||
</ItemGroup>
|
||||
<Target Name="PreBuildWindows" BeforeTargets="PreBuildEvent" Condition="'$(RuntimeIdentifier)'!='linux-x64'">
|
||||
|
||||
<Target Name="PreBuildWindows" BeforeTargets="PreBuildEvent" Condition="'$(RuntimeIdentifier)'=='win-x64'">
|
||||
<Exec Command="cd $(OutDir)
rd Dependencies /s /q
md Dependencies
xcopy /s $(ProjectDir)Dependencies\* Dependencies
copy libHarfBuzzSharp.dll Dependencies
copy libSkiaSharp.dll Dependencies
copy MesenCore.dll Dependencies
cd Dependencies
del ..\Dependencies.zip
powershell Compress-Archive -Path * -DestinationPath '..\Dependencies.zip' -Force
copy ..\Dependencies.zip $(ProjectDir)" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup Condition="'$(RuntimeIdentifier)'=='linux-x64'">
|
||||
<OutputPath>..\bin\x64\Release\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<Target Name="PreBuildLinux" BeforeTargets="PreBuildEvent" Condition="'$(RuntimeIdentifier)'=='linux-x64'">
|
||||
<Exec Command="cd $(OutDir)
rm Dependencies -r
mkdir Dependencies
cp -R $(ProjectDir)/Dependencies/* Dependencies
cp libHarfBuzzSharp.so Dependencies
cp libSkiaSharp.so Dependencies
cp libMesenCore.dll Dependencies
cd Dependencies
rm ../Dependencies.zip
zip -r ../Dependencies.zip *
cp ../Dependencies.zip $(ProjectDir)" />
|
||||
</Target>
|
||||
<Exec Command="cd $(OutDir)
rm -r Dependencies
mkdir Dependencies
cp -R $(ProjectDir)/Dependencies/* Dependencies
cp libHarfBuzzSharp.so Dependencies
cp libSkiaSharp.so Dependencies
cp MesenCore.so Dependencies
cd Dependencies
rm ../Dependencies.zip
zip -r ../Dependencies.zip *
cp ../Dependencies.zip $(ProjectDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PreBuildOsx" BeforeTargets="PreBuildEvent" Condition="'$(RuntimeIdentifier)'=='osx-x64' Or '$(RuntimeIdentifier)'=='osx-arm64'">
|
||||
<Exec Command="cd $(OutDir)
rm -R Dependencies
mkdir Dependencies
cp -R $(ProjectDir)/Dependencies/* Dependencies
cp libHarfBuzzSharp.dylib Dependencies
cp libSkiaSharp.dylib Dependencies
cp MesenCore.dylib Dependencies
cd Dependencies
rm ../Dependencies.zip
zip -r ../Dependencies.zip *
cp ../Dependencies.zip $(ProjectDir)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -24,6 +24,7 @@ namespace Mesen.ViewModels
|
|||
[Reactive] public string InstallLocation { get; set; }
|
||||
|
||||
[Reactive] public bool CreateShortcut { get; set; } = true;
|
||||
[Reactive] public bool IsOsx { get; set; } = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
|
||||
public SetupWizardViewModel()
|
||||
{
|
||||
|
@ -95,6 +96,11 @@ namespace Mesen.ViewModels
|
|||
|
||||
private void CreateShortcutFile()
|
||||
{
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
|
||||
//TODO OSX
|
||||
return;
|
||||
}
|
||||
|
||||
if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
|
||||
Type? t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8"));
|
||||
if(t == null) {
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</Grid>
|
||||
</c:OptionSection>
|
||||
|
||||
<c:OptionSection Header="{l:Translate lblMiscOptions}" Margin="0 25 0 0">
|
||||
<c:OptionSection Header="{l:Translate lblMiscOptions}" Margin="0 25 0 0" IsVisible="{CompiledBinding !IsOsx}">
|
||||
<CheckBox Content="{l:Translate chkCreateShortcut}" IsChecked="{CompiledBinding CreateShortcut}" />
|
||||
</c:OptionSection>
|
||||
</StackPanel>
|
||||
|
|
|
@ -69,25 +69,25 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(ProjectDir);$(SolutionDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(ProjectDir);$(SolutionDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(ProjectDir);$(SolutionDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(ProjectDir);$(SolutionDir);$(IncludePath)</IncludePath>
|
||||
|
|
|
@ -69,25 +69,25 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Profile|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||
<IntDir>obj\$(Platform)\$(Configuration)\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGO Optimize|x64'">
|
||||
<OutDir>$(SolutionDir)\bin\$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<OutDir>$(SolutionDir)\bin\win-$(PlatformTarget)\PGO Profile\</OutDir>
|
||||
<IntDir>obj\$(Platform)\PGO Profile\</IntDir>
|
||||
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
|
||||
<IncludePath>$(SolutionDir)/Core;$(SolutionDir);$(ProjectDir);$(IncludePath)</IncludePath>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# ROM files must be copied to the PGOHelper/PGOGames folder beforehand - all supported rom files in that folder will be executed as part of the profiling process.
|
||||
# Using a variety of roms is recommended (e.g different consoles/mappers, etc.)
|
||||
#
|
||||
# This will produce the following binary: bin/x64/Release/linux-x64/publish/Mesen
|
||||
# This will produce the following binary: bin/linux-x64/Release/linux-x64/publish/Mesen
|
||||
PLAT="x64"
|
||||
TARG="core"
|
||||
|
||||
|
|
65
makefile
65
makefile
|
@ -20,9 +20,38 @@ endif
|
|||
|
||||
CXXFLAGS=-fPIC -Wall --std=c++17 -O3 $(MESENFLAGS) -I/usr/include/SDL2 -I $(realpath ./) -I $(realpath ./Core) -I $(realpath ./Utilities) -I $(realpath ./Linux)
|
||||
CFLAGS=-fPIC -Wall -O3 $(MESENFLAGS)
|
||||
LINKOPTIONS=
|
||||
|
||||
MESENPLATFORM=x64
|
||||
LINKCHECKUNRESOLVED=-Wl,-z,defs
|
||||
|
||||
LINKOPTIONS=
|
||||
MESENOS=
|
||||
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
MESENOS=linux
|
||||
SHAREDLIB=MesenCore.so
|
||||
endif
|
||||
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
MESENOS=osx
|
||||
SHAREDLIB=MesenCore.dylib
|
||||
LTO=false
|
||||
STATICLINK := false
|
||||
LINKCHECKUNRESOLVED=
|
||||
endif
|
||||
|
||||
UNAME_P := $(shell uname -p)
|
||||
ifeq ($(UNAME_P),x86_64)
|
||||
MESENPLATFORM=$(MESENOS)-x64
|
||||
endif
|
||||
ifneq ($(filter %86,$(UNAME_P)),)
|
||||
MESENPLATFORM=$(MESENOS)-x64
|
||||
endif
|
||||
ifneq ($(filter arm%,$(UNAME_P)),)
|
||||
MESENPLATFORM=$(MESENOS)-arm64
|
||||
endif
|
||||
|
||||
CXXFLAGS += -m64
|
||||
CFLAGS += -m64
|
||||
|
||||
|
@ -46,7 +75,6 @@ ifneq ($(STATICLINK),false)
|
|||
endif
|
||||
|
||||
OBJFOLDER=obj.$(MESENPLATFORM)
|
||||
SHAREDLIB=libMesenCore.dll
|
||||
RELEASEFOLDER=bin/$(MESENPLATFORM)/Release
|
||||
|
||||
CORESRC := $(shell find Core -name '*.cpp')
|
||||
|
@ -80,27 +108,27 @@ SDL2LIB=$(shell sdl2-config --libs)
|
|||
SDL2INC=$(shell sdl2-config --cflags)
|
||||
FSLIB=-lstdc++fs
|
||||
|
||||
ifeq ($(MESENOS),osx)
|
||||
LIBEVDEVOBJ :=
|
||||
LIBEVDEVINC :=
|
||||
LIBEVDEVSRC :=
|
||||
FSLIB :=
|
||||
endif
|
||||
|
||||
all: ui
|
||||
|
||||
ui: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
|
||||
mkdir -p $(RELEASEFOLDER)/Dependencies
|
||||
rm -fr $(RELEASEFOLDER)/Dependencies/*
|
||||
cp InteropDLL/$(OBJFOLDER)/$(SHAREDLIB) bin/x64/Release/$(SHAREDLIB)
|
||||
cd UI && dotnet publish -c Release -r linux-x64 -p:Platform="$(MESENPLATFORM)" -p:OptimizeUi="true" --no-self-contained true -p:PublishSingleFile=true
|
||||
rm $(RELEASEFOLDER)/linux-x64/publish/lib*
|
||||
cp InteropDLL/$(OBJFOLDER)/$(SHAREDLIB) bin/$(MESENPLATFORM)/Release/$(SHAREDLIB)
|
||||
#Called twice because the first call copies native libraries to the bin folder which need to be included in Dependencies.zip
|
||||
cd UI && dotnet publish -c Release -r $(MESENPLATFORM) -p:Platform="x64" -p:OptimizeUi="true" --no-self-contained true -p:PublishSingleFile=true
|
||||
cd UI && dotnet publish -c Release -r $(MESENPLATFORM) -p:Platform="x64" -p:OptimizeUi="true" --no-self-contained true -p:PublishSingleFile=true
|
||||
|
||||
core: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
|
||||
|
||||
runtests:
|
||||
cd TestHelper/$(OBJFOLDER) && ./testhelper
|
||||
|
||||
testhelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
|
||||
mkdir -p TestHelper/$(OBJFOLDER)
|
||||
$(CXX) $(CXXFLAGS) -Wl,-z,defs -o testhelper TestHelper/*.cpp InteropDLL/ConsoleWrapper.cpp $(SEVENZIPOBJ) $(LUAOBJ) $(LINUXOBJ) $(LIBEVDEVOBJ) $(UTILOBJ) $(COREOBJ) -pthread $(FSLIB) $(SDL2LIB) $(LIBEVDEVLIB)
|
||||
mv testhelper TestHelper/$(OBJFOLDER)
|
||||
|
||||
pgohelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
|
||||
mkdir -p PGOHelper/$(OBJFOLDER) && cd PGOHelper/$(OBJFOLDER) && $(CXX) $(CXXFLAGS) -Wl,-z,defs -o pgohelper ../PGOHelper.cpp ../../bin/pgohelperlib.so -pthread $(FSLIB) $(SDL2LIB) $(LIBEVDEVLIB)
|
||||
mkdir -p PGOHelper/$(OBJFOLDER) && cd PGOHelper/$(OBJFOLDER) && $(CXX) $(CXXFLAGS) $(LINKCHECKUNRESOLVED) -o pgohelper ../PGOHelper.cpp ../../bin/pgohelperlib.so -pthread $(FSLIB) $(SDL2LIB) $(LIBEVDEVLIB)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
@ -111,18 +139,15 @@ pgohelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
|
|||
InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(LUAOBJ) $(UTILOBJ) $(COREOBJ) $(LIBEVDEVOBJ) $(LINUXOBJ) $(DLLOBJ)
|
||||
mkdir -p bin
|
||||
mkdir -p InteropDLL/$(OBJFOLDER)
|
||||
$(CXX) $(CXXFLAGS) $(LINKOPTIONS) -Wl,-z,defs -shared -o $(SHAREDLIB) $(DLLOBJ) $(SEVENZIPOBJ) $(LUAOBJ) $(LINUXOBJ) $(LIBEVDEVOBJ) $(UTILOBJ) $(COREOBJ) $(SDL2INC) -pthread $(FSLIB) $(SDL2LIB) $(LIBEVDEVLIB)
|
||||
$(CXX) $(CXXFLAGS) $(LINKOPTIONS) $(LINKCHECKUNRESOLVED) -shared -o $(SHAREDLIB) $(DLLOBJ) $(SEVENZIPOBJ) $(LUAOBJ) $(LINUXOBJ) $(LIBEVDEVOBJ) $(UTILOBJ) $(COREOBJ) $(SDL2INC) -pthread $(FSLIB) $(SDL2LIB) $(LIBEVDEVLIB)
|
||||
cp $(SHAREDLIB) bin/pgohelperlib.so
|
||||
mv $(SHAREDLIB) InteropDLL/$(OBJFOLDER)
|
||||
|
||||
pgo:
|
||||
./buildPGO.sh
|
||||
|
||||
official:
|
||||
./build.sh
|
||||
|
||||
run:
|
||||
./UI/bin/x64/Release/linux-x64/publish/Mesen
|
||||
./UI/bin/$(MESENPLATFORM)/Release/$(MESENPLATFORM)/publish/Mesen
|
||||
|
||||
clean:
|
||||
rm -r -f $(COREOBJ)
|
||||
|
|
Loading…
Add table
Reference in a new issue