Skip to content

Commit

Permalink
add lower case naming, add pdb generation for cpu_info
Browse files Browse the repository at this point in the history
  • Loading branch information
iranrmrf committed Sep 17, 2022
1 parent fd464f4 commit fbe4e42
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
22 changes: 15 additions & 7 deletions build_definitions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,37 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<GAME>FNV</GAME>
<HR_GAME>FNV</HR_GAME>
<HR_GAME_DIR>C:/Games/Fallout New Vegas</HR_GAME_DIR>
<HR_NAME>NVHR</HR_NAME>
<HR_NAME_LOWER>nvhr</HR_NAME_LOWER>
<ARCH>AVX2</ARCH>
<GAME_DIR>"C:/Games/Fallout New Vegas"</GAME_DIR>
<ARCH_LOWER>avx2</ARCH_LOWER>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;HR_NAME="$(HR_NAME)";$(GAME);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;$(HR_GAME);HR_NAME="$(HR_NAME)";HR_NAME_LOWER="$(HR_NAME_LOWER)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="GAME">
<Value>$(GAME)</Value>
<BuildMacro Include="HR_GAME">
<Value>$(HR_GAME)</Value>
</BuildMacro>
<BuildMacro Include="HR_GAME_DIR">
<Value>$(HR_GAME_DIR)</Value>
</BuildMacro>
<BuildMacro Include="HR_NAME">
<Value>$(HR_NAME)</Value>
</BuildMacro>
<BuildMacro Include="HR_NAME_LOWER">
<Value>$(HR_NAME_LOWER)</Value>
</BuildMacro>
<BuildMacro Include="ARCH">
<Value>$(ARCH)</Value>
</BuildMacro>
<BuildMacro Include="GAME_DIR">
<Value>$(GAME_DIR)</Value>
<BuildMacro Include="ARCH_LOWER">
<Value>$(ARCH_LOWER)</Value>
</BuildMacro>
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions cpu_info/cpu_info.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<ConformanceMode>true</ConformanceMode>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<LanguageStandard>stdcpp20</LanguageStandard>
<DebugInformationFormat>None</DebugInformationFormat>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
Expand All @@ -70,10 +70,10 @@
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>false</GenerateDebugInformation>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" "C:\Games\Fallout New Vegas\$(TargetFileName)"</Command>
<Command>copy "$(TargetPath)" "$(HR_GAME_DIR)\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
8 changes: 5 additions & 3 deletions cpu_info/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ enum
};

const char *iset_names[] = {
[IA32] = "IA32.dll", [SSE] = "SSE.dll", [SSE2] = "SSE2.dll",
[AVX] = "AVX.dll", [AVX2] = "AVX2.dll", [AVX512] = "AVX512.dll"};
[IA32] = HR_NAME_LOWER "_ia32.dll", [SSE] = HR_NAME_LOWER "_sse.dll",
[SSE2] = HR_NAME_LOWER "_sse2.dll", [AVX] = HR_NAME_LOWER "_avx.dll",
[AVX2] = HR_NAME_LOWER "_avx2.dll", [AVX512] = HR_NAME_LOWER "_axvx512.dll",
};

int get_min_iset(void)
{
Expand Down Expand Up @@ -132,7 +134,7 @@ int get_min_iset(void)
BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved)
{
int iset;
char buff[256] = "Data\\" HR_NAME "\\";
char buff[MAX_PATH] = "Data\\" HR_NAME "\\";

if (fdwReason == DLL_PROCESS_ATTACH)
{
Expand Down
4 changes: 2 additions & 2 deletions heap_replacer/heap_replacer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)binaries\$(Configuration)\$(ProjectName)\$(Arch)\</OutDir>
<IntDir>$(SolutionDir)intermediates\$(Configuration)\$(ProjectName)\$(Arch)\</IntDir>
<TargetName>$(ARCH)</TargetName>
<TargetName>$(HR_NAME_LOWER)_$(ARCH_LOWER)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
Expand Down Expand Up @@ -74,7 +74,7 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<PostBuildEvent>
<Command>copy "$(TargetPath)" $(GAME_DIR)\Data\$(HR_NAME)\$(TargetFileName)"</Command>
<Command>copy "$(TargetPath)" "$(HR_GAME_DIR)\Data\$(HR_NAME)\$(TargetFileName)"</Command>
</PostBuildEvent>
<ProjectReference>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
Expand Down

0 comments on commit fbe4e42

Please sign in to comment.