Skip to content

Commit

Permalink
Update project configuration (#102)
Browse files Browse the repository at this point in the history
Fixed SDK includes.
Configured post build events and debug settings.
Added setup_env.bat and SETUP.md
  • Loading branch information
MiranDMC authored Sep 19, 2023
1 parent a3041e1 commit 03bdb17
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 33 deletions.
12 changes: 6 additions & 6 deletions CLEO4.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2002
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CLEO4", "CLEO4.vcxproj", "{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}"
EndProject
Expand All @@ -11,10 +11,10 @@ Global
Release|GTASA = Release|GTASA
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.ActiveCfg = Debug GTASA|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.Build.0 = Debug GTASA|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.ActiveCfg = Release GTASA|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.Build.0 = Release GTASA|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.ActiveCfg = Debug|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Debug|GTASA.Build.0 = Debug|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.ActiveCfg = Release|Win32
{B212DDA4-2A8E-45B2-914D-7BEEB31D06B1}.Release|GTASA.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
62 changes: 35 additions & 27 deletions CLEO4.vcxproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release GTASA|Win32">
<Configuration>Release GTASA</Configuration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug GTASA|Win32">
<Configuration>Debug GTASA</Configuration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
Expand All @@ -26,8 +26,8 @@
<ClCompile Include="source\dllmain.cpp" />
<ClCompile Include="source\PluginSdkExternals.cpp" />
<ClCompile Include="source\stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release GTASA|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug GTASA|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -62,46 +62,47 @@
<IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>
<Keyword>Win32Proj</Keyword>
<RootNamespace>CLEO4</RootNamespace>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release GTASA|Win32'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GTASA|Win32'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release GTASA|Win32'">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug GTASA|Win32'">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release GTASA|Win32'">
<OutDir>$(SolutionDir)output\Release\</OutDir>
<IntDir>$(SolutionDir)output\.obj\Release\</IntDir>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)output\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)output\.obj\$(Configuration)\</IntDir>
<TargetName>CLEO</TargetName>
<TargetExt>.asi</TargetExt>
<IncludePath>$(PLUGIN_SDK_DIR)\shared\;$(PLUGIN_SDK_DIR)\shared\game\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug GTASA|Win32'">
<OutDir>$(SolutionDir)output\Debug\</OutDir>
<IntDir>$(SolutionDir)output\.obj\Debug\</IntDir>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)output\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)output\.obj\$(Configuration)\</IntDir>
<TargetName>CLEO</TargetName>
<TargetExt>.asi</TargetExt>
<IncludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);E:\Documents\Para GTA\plugin-sdk-master\shared</IncludePath>
<IncludePath>$(PLUGIN_SDK_DIR)\shared\;$(PLUGIN_SDK_DIR)\shared\game\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release GTASA|Win32'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
Expand All @@ -113,11 +114,12 @@
<PreprocessorDefinitions>_NDEBUG;_USING_V110_SDK71_;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;GTASA;GTAGAME_NAME="San Andreas";GTAGAME_ABBR="SA";GTAGAME_ABBRLOW="sa";GTAGAME_PROTAGONISTNAME="CJ";GTAGAME_CITYNAME="San Andreas";CLEO4_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Create</PrecompiledHeader>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>No</GenerateDebugInformation>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(SolutionDir)\third-party\bass;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>bass.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand All @@ -126,10 +128,13 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<PostBuildEvent>
<Command>xcopy /Y "$(SolutionDir)output\Release\CLEO.lib" "$(SolutionDir)cleo_sdk\" </Command>
<Command>xcopy /Y "$(OutDir)$(TargetName).lib" "$(SolutionDir)cleo_sdk\"
taskkill /IM gta_sa.exe /F /FI "STATUS eq RUNNING"
xcopy /Y "$(OutDir)$(TargetName).asi" "$(GTA_SA_DIR)\"
xcopy /Y "$(OutDir)$(TargetName).pdb" "$(GTA_SA_DIR)\" </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug GTASA|Win32'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
Expand All @@ -139,9 +144,10 @@
<PreprocessorDefinitions>_DEBUG;_USING_V110_SDK71_;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS;_SCL_SECURE_NO_WARNINGS;GTASA;GTAGAME_NAME="San Andreas";GTAGAME_ABBR="SA";GTAGAME_ABBRLOW="sa";GTAGAME_PROTAGONISTNAME="CJ";GTAGAME_CITYNAME="San Andreas";CLEO4_EXPORTS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Create</PrecompiledHeader>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<GenerateDebugInformation>Debug</GenerateDebugInformation>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
<AdditionalLibraryDirectories>$(SolutionDir)\third-party\bass;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>bass.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand All @@ -150,8 +156,10 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<PostBuildEvent>
<Command>
</Command>
<Command>xcopy /Y "$(OutDir)$(TargetName).lib" "$(SolutionDir)cleo_sdk\"
taskkill /IM gta_sa.exe /F /FI "STATUS eq RUNNING"
xcopy /Y "$(OutDir)$(TargetName).asi" "$(GTA_SA_DIR)\"
xcopy /Y "$(OutDir)$(TargetName).pdb" "$(GTA_SA_DIR)\" </Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
7 changes: 7 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# CLEO project configuration

This project depends on Plugin SDK (https://github.com/DK22Pac/plugin-sdk). Using SDK's installer results in creation of PLUGIN_SDK_DIR envinroment variable in operating system. If installer is not used then please manually enter path to the sdk directory in setup_env.bat.
If GTA SA is installed in different than default location please open setup_env.bat file and configure correct path.
Run setup_env.bat to setup required envinroment variables.

After opening project solution in Visual Studio it should be possible to build as well as debug CLEO in game.
55 changes: 55 additions & 0 deletions setup_env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@ECHO OFF

@SET GAME_DIR=C:\Program Files (x86)\Rockstar Games\GTA San Andreas
@SET PLUGIN_DIR=C:\plugin-sdk-master











@IF DEFINED GTA_SA_DIR (
ECHO GTA_SA_DIR already set to:
ECHO "%GTA_SA_DIR%"
ECHO:
ECHO New value:
ECHO "%GAME_DIR%"
ECHO:
CHOICE /C YN /M "Do you want to update?"
If ERRORLEVEL 2 GOTO SET_GAME_END
)

@SETX GTA_SA_DIR "%GAME_DIR%"
ECHO GTA_SA_DIR configured as:
ECHO "%GAME_DIR%"
:SET_GAME_END

ECHO:
ECHO:

@IF DEFINED PLUGIN_SDK_DIR (
ECHO PLUGIN_SDK_DIR already set to:
ECHO "%PLUGIN_SDK_DIR%"
ECHO .
ECHO New value:
ECHO "%PLUGIN_DIR%"
ECHO .
CHOICE /C YN /M "Do you want to update?"
If ERRORLEVEL 2 GOTO SET_PLUGIN_END
)

@SETX PLUGIN_SDK_DIR "%PLUGIN_DIR%"
ECHO PLUGIN_SDK_DIR configured as:
ECHO "%PLUGIN_DIR%"
:SET_PLUGIN_END

ECHO:
ECHO:

pause
exit

0 comments on commit 03bdb17

Please sign in to comment.