Skip to content

Commit fbe4e42

Browse files
committed
add lower case naming, add pdb generation for cpu_info
1 parent fd464f4 commit fbe4e42

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

build_definitions.props

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,37 @@
22
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ImportGroup Label="PropertySheets" />
44
<PropertyGroup Label="UserMacros">
5-
<GAME>FNV</GAME>
5+
<HR_GAME>FNV</HR_GAME>
6+
<HR_GAME_DIR>C:/Games/Fallout New Vegas</HR_GAME_DIR>
67
<HR_NAME>NVHR</HR_NAME>
8+
<HR_NAME_LOWER>nvhr</HR_NAME_LOWER>
79
<ARCH>AVX2</ARCH>
8-
<GAME_DIR>"C:/Games/Fallout New Vegas"</GAME_DIR>
10+
<ARCH_LOWER>avx2</ARCH_LOWER>
911
</PropertyGroup>
1012
<PropertyGroup />
1113
<ItemDefinitionGroup>
1214
<ClCompile>
13-
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;HR_NAME="$(HR_NAME)";$(GAME);%(PreprocessorDefinitions)</PreprocessorDefinitions>
15+
<PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;$(HR_GAME);HR_NAME="$(HR_NAME)";HR_NAME_LOWER="$(HR_NAME_LOWER)";%(PreprocessorDefinitions)</PreprocessorDefinitions>
1416
</ClCompile>
1517
</ItemDefinitionGroup>
1618
<ItemGroup>
17-
<BuildMacro Include="GAME">
18-
<Value>$(GAME)</Value>
19+
<BuildMacro Include="HR_GAME">
20+
<Value>$(HR_GAME)</Value>
21+
</BuildMacro>
22+
<BuildMacro Include="HR_GAME_DIR">
23+
<Value>$(HR_GAME_DIR)</Value>
1924
</BuildMacro>
2025
<BuildMacro Include="HR_NAME">
2126
<Value>$(HR_NAME)</Value>
2227
</BuildMacro>
28+
<BuildMacro Include="HR_NAME_LOWER">
29+
<Value>$(HR_NAME_LOWER)</Value>
30+
</BuildMacro>
2331
<BuildMacro Include="ARCH">
2432
<Value>$(ARCH)</Value>
2533
</BuildMacro>
26-
<BuildMacro Include="GAME_DIR">
27-
<Value>$(GAME_DIR)</Value>
34+
<BuildMacro Include="ARCH_LOWER">
35+
<Value>$(ARCH_LOWER)</Value>
2836
</BuildMacro>
2937
</ItemGroup>
3038
</Project>

cpu_info/cpu_info.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<ConformanceMode>true</ConformanceMode>
5555
<LanguageStandard_C>stdc17</LanguageStandard_C>
5656
<LanguageStandard>stdcpp20</LanguageStandard>
57-
<DebugInformationFormat>None</DebugInformationFormat>
57+
<DebugInformationFormat>OldStyle</DebugInformationFormat>
5858
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
5959
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
6060
<OmitFramePointers>true</OmitFramePointers>
@@ -70,10 +70,10 @@
7070
<SubSystem>Console</SubSystem>
7171
<EnableCOMDATFolding>true</EnableCOMDATFolding>
7272
<OptimizeReferences>true</OptimizeReferences>
73-
<GenerateDebugInformation>false</GenerateDebugInformation>
73+
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
7474
</Link>
7575
<PostBuildEvent>
76-
<Command>copy "$(TargetPath)" "C:\Games\Fallout New Vegas\$(TargetFileName)"</Command>
76+
<Command>copy "$(TargetPath)" "$(HR_GAME_DIR)\$(TargetFileName)"</Command>
7777
</PostBuildEvent>
7878
</ItemDefinitionGroup>
7979
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

cpu_info/main.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ enum
2626
};
2727

2828
const char *iset_names[] = {
29-
[IA32] = "IA32.dll", [SSE] = "SSE.dll", [SSE2] = "SSE2.dll",
30-
[AVX] = "AVX.dll", [AVX2] = "AVX2.dll", [AVX512] = "AVX512.dll"};
29+
[IA32] = HR_NAME_LOWER "_ia32.dll", [SSE] = HR_NAME_LOWER "_sse.dll",
30+
[SSE2] = HR_NAME_LOWER "_sse2.dll", [AVX] = HR_NAME_LOWER "_avx.dll",
31+
[AVX2] = HR_NAME_LOWER "_avx2.dll", [AVX512] = HR_NAME_LOWER "_axvx512.dll",
32+
};
3133

3234
int get_min_iset(void)
3335
{
@@ -132,7 +134,7 @@ int get_min_iset(void)
132134
BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved)
133135
{
134136
int iset;
135-
char buff[256] = "Data\\" HR_NAME "\\";
137+
char buff[MAX_PATH] = "Data\\" HR_NAME "\\";
136138

137139
if (fdwReason == DLL_PROCESS_ATTACH)
138140
{

heap_replacer/heap_replacer.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<LinkIncremental>false</LinkIncremental>
3636
<OutDir>$(SolutionDir)binaries\$(Configuration)\$(ProjectName)\$(Arch)\</OutDir>
3737
<IntDir>$(SolutionDir)intermediates\$(Configuration)\$(ProjectName)\$(Arch)\</IntDir>
38-
<TargetName>$(ARCH)</TargetName>
38+
<TargetName>$(HR_NAME_LOWER)_$(ARCH_LOWER)</TargetName>
3939
</PropertyGroup>
4040
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
4141
<ClCompile>
@@ -74,7 +74,7 @@
7474
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
7575
</Link>
7676
<PostBuildEvent>
77-
<Command>copy "$(TargetPath)" $(GAME_DIR)\Data\$(HR_NAME)\$(TargetFileName)"</Command>
77+
<Command>copy "$(TargetPath)" "$(HR_GAME_DIR)\Data\$(HR_NAME)\$(TargetFileName)"</Command>
7878
</PostBuildEvent>
7979
<ProjectReference>
8080
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>

0 commit comments

Comments
 (0)