Skip to content

Commit d7a7074

Browse files
committed
More changes to enable version/filename in binaries
1 parent 54d2b32 commit d7a7074

File tree

11 files changed

+60
-9
lines changed

11 files changed

+60
-9
lines changed

Build/Common.Build.settings

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@
9999
<Link>
100100
<GenerateDebugInformation>true</GenerateDebugInformation>
101101
</Link>
102+
<ResourceCompile>
103+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='140'">TOOLSET_VERSION_140;%(PreprocessorDefinitions)</PreprocessorDefinitions>
105+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='120'">TOOLSET_VERSION_120;%(PreprocessorDefinitions)</PreprocessorDefinitions>
106+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='110'">TOOLSET_VERSION_110;%(PreprocessorDefinitions)</PreprocessorDefinitions>
107+
</ResourceCompile>
102108
</ItemDefinitionGroup>
103109

104110
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -108,6 +114,12 @@
108114
<Link>
109115
<GenerateDebugInformation>true</GenerateDebugInformation>
110116
</Link>
117+
<ResourceCompile>
118+
<PreprocessorDefinitions>_WIN64;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
119+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='140'">TOOLSET_VERSION_140;%(PreprocessorDefinitions)</PreprocessorDefinitions>
120+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='120'">TOOLSET_VERSION_120;%(PreprocessorDefinitions)</PreprocessorDefinitions>
121+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='110'">TOOLSET_VERSION_110;%(PreprocessorDefinitions)</PreprocessorDefinitions>
122+
</ResourceCompile>
111123
</ItemDefinitionGroup>
112124

113125
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
@@ -117,6 +129,12 @@
117129
<Link>
118130
<GenerateDebugInformation>true</GenerateDebugInformation>
119131
</Link>
132+
<ResourceCompile>
133+
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)%(PreprocessorDefinitions)</PreprocessorDefinitions>
134+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='140'">TOOLSET_VERSION_140;%(PreprocessorDefinitions)</PreprocessorDefinitions>
135+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='120'">TOOLSET_VERSION_120;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='110'">TOOLSET_VERSION_110;%(PreprocessorDefinitions)</PreprocessorDefinitions>
137+
</ResourceCompile>
120138
</ItemDefinitionGroup>
121139

122140
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -126,6 +144,12 @@
126144
<Link>
127145
<GenerateDebugInformation>true</GenerateDebugInformation>
128146
</Link>
147+
<ResourceCompile>
148+
<PreprocessorDefinitions>_WIN64;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
149+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='140'">TOOLSET_VERSION_140;%(PreprocessorDefinitions)</PreprocessorDefinitions>
150+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='120'">TOOLSET_VERSION_120;%(PreprocessorDefinitions)</PreprocessorDefinitions>
151+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='110'">TOOLSET_VERSION_110;%(PreprocessorDefinitions)</PreprocessorDefinitions>
152+
</ResourceCompile>
129153
</ItemDefinitionGroup>
130154

131155
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
@@ -135,6 +159,12 @@
135159
<Link>
136160
<GenerateDebugInformation>true</GenerateDebugInformation>
137161
</Link>
162+
<ResourceCompile>
163+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
164+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='140'">TOOLSET_VERSION_140;%(PreprocessorDefinitions)</PreprocessorDefinitions>
165+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='120'">TOOLSET_VERSION_120;%(PreprocessorDefinitions)</PreprocessorDefinitions>
166+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='110'">TOOLSET_VERSION_110;%(PreprocessorDefinitions)</PreprocessorDefinitions>
167+
</ResourceCompile>
138168
</ItemDefinitionGroup>
139169

140170
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -144,6 +174,12 @@
144174
<Link>
145175
<GenerateDebugInformation>true</GenerateDebugInformation>
146176
</Link>
177+
<ResourceCompile>
178+
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
179+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='140'">TOOLSET_VERSION_140;%(PreprocessorDefinitions)</PreprocessorDefinitions>
180+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='120'">TOOLSET_VERSION_120;%(PreprocessorDefinitions)</PreprocessorDefinitions>
181+
<PreprocessorDefinitions Condition="'$(DevToolsVersion)'=='110'">TOOLSET_VERSION_110;%(PreprocessorDefinitions)</PreprocessorDefinitions>
182+
</ResourceCompile>
147183
</ItemDefinitionGroup>
148184

149185
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
@@ -189,7 +225,7 @@
189225

190226
<!--end paths configuration -->
191227
<Target Name="CopyToOutputDirectoryAlwaysError"
192-
Condition="'@(Content)'!='' or '@(None)'!=''">
228+
Condition="'@(Content)'!='' or '@(None)'!=''">
193229
<Error Condition="'%(Content.CopyToOutputDirectory)'=='Always'" Text="CopyToOutputDirectory is not allowed to be 'Always'. Use 'PreserveNewest' instead." File="$(MSBuildProjectFile)" />
194230
<Error Condition="'%(None.CopyToOutputDirectory)'=='Always'" Text="CopyToOutputDirectory is not allowed to be 'Always'. Use 'PreserveNewest' instead." File="$(MSBuildProjectFile)" />
195231
</Target>
@@ -222,7 +258,7 @@
222258
<!-- Remove all items from _ResolvedProjectReferencePaths that have non-default value for CopyToOutputDirectory -->
223259
<Target Name="Cleanup_ResolvedProjectReferencePaths"
224260
BeforeTargets="ResolveAssemblyReferences"
225-
Condition="'@(_ResolvedProjectReferencePaths)' != ''">
261+
Condition="'@(_ResolvedProjectReferencePaths)' != ''">
226262
<Message Text="Before Cleanup_ResolvedProjectReferencePaths (CopyToOutputDirectory = %(CopyToOutputDirectory)): @(_ResolvedProjectReferencePaths)"
227263
Importance="Low" />
228264
<ItemGroup>

Release/include/cpprest/version.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,4 @@
1919
#define CPPREST_VERSION_MINOR 6
2020
#define CPPREST_VERSION_MAJOR 2
2121

22-
#if (defined(_MSC_VER) && (_MSC_VER >= 1900))
23-
#define CPPREST_TOOLSET 140
24-
#elif (defined(_MSC_VER) && (_MSC_VER >= 1800))
25-
#define CPPREST_TOOLSET 120
26-
#endif
27-
2822
#define CPPREST_VERSION (CPPREST_VERSION_MAJOR*100000+CPPREST_VERSION_MINOR*100+CPPREST_VERSION_REVISION)

Release/src/build/common.vcxitems.filters

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\include\cpprest\version.h">
207207
<Filter>Header Files\cpprest</Filter>
208208
</ClInclude>
209+
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\include\cpprest\details\resource.h" />
209210
</ItemGroup>
210211
<ItemGroup>
211212
<None Include="$(MSBuildThisFileDirectory)..\..\include\cpprest\details\http_constants.dat">
@@ -215,4 +216,7 @@
215216
<ItemGroup>
216217
<Xml Include="$(MSBuildThisFileDirectory)package_info.xml" />
217218
</ItemGroup>
219+
<ItemGroup>
220+
<ResourceCompile Include="$(MSBuildThisFileDirectory)..\utilities\Resource.rc" />
221+
</ItemGroup>
218222
</Project>

Release/src/build/vs12.winrt/casablanca120.winrt.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<LinkTimeCodeGeneration Condition="'$(Configuration)'=='Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
5353
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
5454
</Link>
55+
<ResourceCompile>
56+
<PreprocessorDefinitions>TARGET_APP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
57+
</ResourceCompile>
5558
</ItemDefinitionGroup>
5659
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
5760
<Import Project="..\winrt.vcxitems" Label="Shared" Condition="Exists('..\winrt.vcxitems')" />

Release/src/build/vs12.wod/casablanca120.wod.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
<AdditionalDependencies>Winhttp.lib;httpapi.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
4646
<LinkTimeCodeGeneration Condition="'$(Configuration)'=='Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
4747
</Link>
48+
<ResourceCompile>
49+
<PreprocessorDefinitions>TARGET_WOD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
50+
</ResourceCompile>
4851
</ItemDefinitionGroup>
4952
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
5053
<Import Project="..\win32.vcxitems" Label="Shared" Condition="Exists('..\win32.vcxitems')" />

Release/src/build/vs12.wp81/casablanca120.wp81.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
5353
<LinkTimeCodeGeneration Condition="'$(Configuration)'=='Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
5454
</Link>
55+
<ResourceCompile>
56+
<PreprocessorDefinitions>TARGET_WP81;%(PreprocessorDefinitions)</PreprocessorDefinitions>
57+
</ResourceCompile>
5558
</ItemDefinitionGroup>
5659
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
5760
<Import Project="..\winrt.vcxitems" Label="Shared" Condition="Exists('..\winrt.vcxitems')" />

Release/src/build/vs12.wps81/casablanca120.wps81.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
5252
<LinkTimeCodeGeneration Condition="'$(Configuration)'=='Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
5353
</Link>
54+
<ResourceCompile>
55+
<PreprocessorDefinitions>TARGET_WPS81;%(PreprocessorDefinitions)</PreprocessorDefinitions>
56+
</ResourceCompile>
5457
</ItemDefinitionGroup>
5558
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
5659
<Import Project="..\winrt.vcxitems" Label="Shared" Condition="Exists('..\winrt.vcxitems')" />

Release/src/build/vs12.xp/casablanca120.xp.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<AdditionalDependencies>Winhttp.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
6868
<LinkTimeCodeGeneration Condition="'$(Configuration)'=='Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
6969
</Link>
70+
<ResourceCompile>
71+
<PreprocessorDefinitions>TARGET_XP;%(PreprocessorDefinitions)</PreprocessorDefinitions>
72+
</ResourceCompile>
7073
</ItemDefinitionGroup>
7174
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
7275
<Import Project="..\win32.vcxitems" Label="Shared" Condition="Exists('..\win32.vcxitems')" />

Release/src/build/vs12/casablanca120.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
<RuntimeLibrary Condition="'$(Configuration)'=='Debug'">MultiThreadedDebugDLL</RuntimeLibrary>
5252
<RuntimeLibrary Condition="'$(Configuration)'=='Release'">MultiThreadedDLL</RuntimeLibrary>
5353
<WholeProgramOptimization Condition="'$(Configuration)'=='Release'">true</WholeProgramOptimization>
54-
5554
<!-- Disable warning about decorated name length exceeded, name was truncated. This is due to Boost.Asio and Websocket++ templates. -->
5655
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
5756
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>

Release/src/build/vs14.wod/casablanca140.wod.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<AdditionalDependencies>Winhttp.lib;httpapi.lib;bcrypt.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>
4444
<LinkTimeCodeGeneration Condition="'$(Configuration)'=='Release'">UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
4545
</Link>
46+
<ResourceCompile>
47+
<PreprocessorDefinitions>TARGET_WOD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
48+
</ResourceCompile>
4649
</ItemDefinitionGroup>
4750
<Import Project="..\common.vcxitems" Label="Shared" Condition="Exists('..\common.vcxitems')" />
4851
<Import Project="..\win32.vcxitems" Label="Shared" Condition="Exists('..\win32.vcxitems')" />

0 commit comments

Comments
 (0)