macOS: Fix compilation scripts/errors for macOS

This commit is contained in:
Sour 2023-02-01 21:10:53 -05:00
parent 70404866e1
commit 9e83a29b93
20 changed files with 147 additions and 82 deletions

View file

@ -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>

View file

@ -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);
}

View file

@ -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;

View file

@ -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];
}

View file

@ -9,6 +9,8 @@ public:
{
}
virtual ~NsfPpu() { }
void UpdateTimings(ConsoleRegion region, bool overclockAllowed) override
{
NesPpu<NsfPpu>::UpdateTimings(region, false);

View file

@ -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

View file

@ -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>

View file

@ -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

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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));
}

View file

@ -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)&#xD;&#xA;rd Dependencies /s /q&#xD;&#xA;md Dependencies&#xD;&#xA;xcopy /s $(ProjectDir)Dependencies\* Dependencies&#xD;&#xA;copy libHarfBuzzSharp.dll Dependencies&#xD;&#xA;copy libSkiaSharp.dll Dependencies&#xD;&#xA;copy MesenCore.dll Dependencies&#xD;&#xA;cd Dependencies&#xD;&#xA;del ..\Dependencies.zip&#xD;&#xA;powershell Compress-Archive -Path * -DestinationPath '..\Dependencies.zip' -Force&#xD;&#xA;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)&#xD;&#xA;rm Dependencies -r&#xD;&#xA;mkdir Dependencies&#xD;&#xA;cp -R $(ProjectDir)/Dependencies/* Dependencies&#xD;&#xA;cp libHarfBuzzSharp.so Dependencies&#xD;&#xA;cp libSkiaSharp.so Dependencies&#xD;&#xA;cp libMesenCore.dll Dependencies&#xD;&#xA;cd Dependencies&#xD;&#xA;rm ../Dependencies.zip&#xD;&#xA;zip -r ../Dependencies.zip *&#xD;&#xA;cp ../Dependencies.zip $(ProjectDir)" />
</Target>
<Exec Command="cd $(OutDir)&#xD;&#xA;rm -r Dependencies&#xD;&#xA;mkdir Dependencies&#xD;&#xA;cp -R $(ProjectDir)/Dependencies/* Dependencies&#xD;&#xA;cp libHarfBuzzSharp.so Dependencies&#xD;&#xA;cp libSkiaSharp.so Dependencies&#xD;&#xA;cp MesenCore.so Dependencies&#xD;&#xA;cd Dependencies&#xD;&#xA;rm ../Dependencies.zip&#xD;&#xA;zip -r ../Dependencies.zip *&#xD;&#xA;cp ../Dependencies.zip $(ProjectDir)" />
</Target>
<Target Name="PreBuildOsx" BeforeTargets="PreBuildEvent" Condition="'$(RuntimeIdentifier)'=='osx-x64' Or '$(RuntimeIdentifier)'=='osx-arm64'">
<Exec Command="cd $(OutDir)&#xD;&#xA;rm -R Dependencies&#xD;&#xA;mkdir Dependencies&#xD;&#xA;cp -R $(ProjectDir)/Dependencies/* Dependencies&#xD;&#xA;cp libHarfBuzzSharp.dylib Dependencies&#xD;&#xA;cp libSkiaSharp.dylib Dependencies&#xD;&#xA;cp MesenCore.dylib Dependencies&#xD;&#xA;cd Dependencies&#xD;&#xA;rm ../Dependencies.zip&#xD;&#xA;zip -r ../Dependencies.zip *&#xD;&#xA;cp ../Dependencies.zip $(ProjectDir)" />
</Target>
</Project>

View file

@ -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) {

View file

@ -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>

View file

@ -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>

View file

@ -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>

View file

@ -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"

View file

@ -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)