mirror of https://github.com/OpenRCT2/OpenRCT2.git
Convert openrct2 to static library
This commit is contained in:
parent
67c0ed8a2f
commit
73b21b5880
46
openrct2.sln
46
openrct2.sln
|
@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2", "src\openrct2\openrct2.vcxproj", "{D24D94F6-2A74-480C-B512-629C306CE92F}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2-lib", "src\openrct2\openrct2-lib.vcxproj", "{D24D94F6-2A74-480C-B512-629C306CE92F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpaint", "test\testpaint\testpaint.vcxproj", "{57E60BA1-FB76-4316-909E-C1449C142327}"
|
||||
EndProject
|
||||
|
@ -25,67 +25,39 @@ Global
|
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
DebugTests|Win32 = DebugTests|Win32
|
||||
DebugTests|x64 = DebugTests|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseTests|Win32 = ReleaseTests|Win32
|
||||
ReleaseTests|x64 = ReleaseTests|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.Build.0 = Debug|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.Build.0 = DebugTests|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.ActiveCfg = DebugTests|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.Build.0 = DebugTests|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.Build.0 = Release|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.ActiveCfg = Release|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.Build.0 = Release|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
|
||||
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|Win32.ActiveCfg = Debug|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|x64.ActiveCfg = Debug|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|x64.ActiveCfg = Release|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|Win32.ActiveCfg = Release|Win32
|
||||
{57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|x64.ActiveCfg = Release|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = DebugTests|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = DebugTests|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.Build.0 = DebugTests|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.ActiveCfg = DebugTests|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.Build.0 = DebugTests|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = ReleaseTests|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = ReleaseTests|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.Build.0 = Debug|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.Build.0 = Release|Win32
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = Release|x64
|
||||
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.Build.0 = Release|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|x64.Build.0 = Debug|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.DebugTests|Win32.Build.0 = DebugTests|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.DebugTests|x64.ActiveCfg = DebugTests|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.DebugTests|x64.Build.0 = DebugTests|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|Win32.Build.0 = Release|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|x64.ActiveCfg = Release|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|x64.Build.0 = Release|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
|
||||
{7A9A57D5-7006-4208-A290-5491BA3C8808}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
|
||||
// Enable visual styles
|
||||
#pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
|
@ -39,7 +40,7 @@ int main(int argc, char * * argv)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int exitCode = 0; // RunOpenRCT2
|
||||
int exitCode = RunOpenRCT2(argc, argv);
|
||||
|
||||
FreeCommandLineArgs(argc, argv);
|
||||
return exitCode;
|
||||
|
@ -58,7 +59,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
return -1;
|
||||
}
|
||||
|
||||
int exitCode = 0; // RunOpenRCT2
|
||||
int exitCode = RunOpenRCT2(argc, argv);
|
||||
|
||||
FreeCommandLineArgs(argc, argv);
|
||||
return exitCode;
|
||||
|
|
|
@ -12,14 +12,6 @@
|
|||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugTests|Win32">
|
||||
<Configuration>DebugTests</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugTests|x64">
|
||||
<Configuration>DebugTests</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -28,14 +20,6 @@
|
|||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseTests|Win32">
|
||||
<Configuration>ReleaseTests</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseTests|x64">
|
||||
<Configuration>ReleaseTests</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7A9A57D5-7006-4208-A290-5491BA3C8808}</ProjectGuid>
|
||||
|
@ -46,6 +30,10 @@
|
|||
<ConfigurationType>Application</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\openrct2.common.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>openrct2</TargetName>
|
||||
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">__NOENTRYPOINT__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -57,6 +45,7 @@
|
|||
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>openrct2-lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem Condition="'$(Configuration)'!='Release'">Console</SubSystem>
|
||||
<SubSystem Condition="'$(Configuration)'=='Release'">Windows</SubSystem>
|
||||
</Link>
|
||||
|
|
|
@ -87,6 +87,10 @@ extern "C"
|
|||
|
||||
int cmdline_run(const char * * argv, int argc);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
int RunOpenRCT2(int argc, char * *);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -12,14 +12,6 @@
|
|||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugTests|Win32">
|
||||
<Configuration>DebugTests</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugTests|x64">
|
||||
<Configuration>DebugTests</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -28,35 +20,23 @@
|
|||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseTests|Win32">
|
||||
<Configuration>ReleaseTests</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseTests|x64">
|
||||
<Configuration>ReleaseTests</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D24D94F6-2A74-480C-B512-629C306CE92F}</ProjectGuid>
|
||||
<RootNamespace>openrct2</RootNamespace>
|
||||
<ProjectName>openrct2</ProjectName>
|
||||
<RootNamespace>openrct2-lib</RootNamespace>
|
||||
<ProjectName>openrct2-lib</ProjectName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<!-- Debug|Win32 is reserved for RCT2 interop builds, this means it has to be a DLL -->
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\openrct2.common.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions Condition="'$(Breakpad)'=='true'">USE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">__NOENTRYPOINT__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
|
@ -64,10 +44,6 @@
|
|||
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
|
||||
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem Condition="'$(Configuration)'!='Release'">Console</SubSystem>
|
||||
<SubSystem Condition="'$(Configuration)'=='Release'">Windows</SubSystem>
|
||||
</Link>
|
||||
<Lib>
|
||||
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine>
|
||||
<TargetMachine Condition="'$(Platform)'=='x64'">MachineX64</TargetMachine>
|
|
@ -55,38 +55,10 @@ utf8 **windows_get_command_line_args(int *outNumArgs);
|
|||
|
||||
static HMODULE _dllModule = NULL;
|
||||
|
||||
#if defined(NO_RCT2) && !defined(__NOENTRYPOINT__)
|
||||
|
||||
/**
|
||||
* Windows entry point to OpenRCT2 without a console window.
|
||||
*/
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
_dllModule = hInstance;
|
||||
|
||||
core_init();
|
||||
|
||||
int argc;
|
||||
char ** argv = (char**)windows_get_command_line_args(&argc);
|
||||
int runGame = cmdline_run((const char **)argv, argc);
|
||||
|
||||
// Free argv
|
||||
for (int i = 0; i < argc; i++) {
|
||||
free(argv[i]);
|
||||
}
|
||||
free(argv);
|
||||
|
||||
if (runGame == 1) {
|
||||
openrct2_launch();
|
||||
}
|
||||
|
||||
return gExitCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Windows entry point to OpenRCT2 with a console window using a traditional C main function.
|
||||
*/
|
||||
int main(int argc, char *argv[])
|
||||
int RunOpenRCT2(int argc, char * * argv)
|
||||
{
|
||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||
_dllModule = hInstance;
|
||||
|
@ -101,7 +73,7 @@ int main(int argc, char *argv[])
|
|||
return gExitCode;
|
||||
}
|
||||
|
||||
#else
|
||||
#ifndef NO_RCT2
|
||||
|
||||
/* DllMain is already defined in one of static libraries we implicitly depend
|
||||
* on (libcrypto), which is their bug really, but since we don't do anything in
|
||||
|
|
|
@ -5,20 +5,20 @@
|
|||
<GtestDir Condition="'$(GtestDir)'==''">$(SolutionDir)lib\googletest\googletest</GtestDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="DebugTests|Win32">
|
||||
<Configuration>DebugTests</Configuration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseTests|Win32">
|
||||
<Configuration>ReleaseTests</Configuration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugTests|x64">
|
||||
<Configuration>DebugTests</Configuration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseTests|x64">
|
||||
<Configuration>ReleaseTests</Configuration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
|
@ -33,7 +33,7 @@
|
|||
<Import Project="..\..\openrct2.common.props" />
|
||||
<PropertyGroup>
|
||||
<OutDir>$(SolutionDir)bin\tests\</OutDir>
|
||||
<IncludePath>$(GtestDir);$(GtestDir)\include;$(SolutionDir)src\openrct2;$(IncludePath)</IncludePath>
|
||||
<IncludePath>$(GtestDir);$(GtestDir)\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
|
@ -41,7 +41,7 @@
|
|||
<PreprocessorDefinitions>GTEST_LANG_CXX11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>openrct2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>openrct2-lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
|
Loading…
Reference in New Issue