Skip to content

Commit f897241

Browse files
committed
Use nlohmann.json NuGet package instead of direct file
This way it will be easier to update to new version (when released). And it will be also clear that we have dependency on this 3rd party library.
1 parent 8f26cae commit f897241

File tree

6 files changed

+22
-24598
lines changed

6 files changed

+22
-24598
lines changed

Src/Lib/DownloadHelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "FNVHash.h"
1414
#include "StringUtils.h"
1515
#include "Translations.h"
16-
#include "json.hpp"
16+
#include <nlohmann/json.hpp>
1717
#include <wininet.h>
1818
#include <softpub.h>
1919

Src/Lib/Lib.vcxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,17 @@
101101
<ClCompile Include="TrackResources.cpp" />
102102
<ClCompile Include="Translations.cpp" />
103103
</ItemGroup>
104+
<ItemGroup>
105+
<None Include="packages.config" />
106+
</ItemGroup>
104107
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
105108
<ImportGroup Label="ExtensionTargets">
109+
<Import Project="..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets" Condition="Exists('..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" />
106110
</ImportGroup>
111+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
112+
<PropertyGroup>
113+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
114+
</PropertyGroup>
115+
<Error Condition="!Exists('..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets'))" />
116+
</Target>
107117
</Project>

Src/Lib/Lib.vcxproj.filters

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,7 @@
149149
<Filter>Lib</Filter>
150150
</ClCompile>
151151
</ItemGroup>
152-
</Project>
152+
<ItemGroup>
153+
<None Include="packages.config" />
154+
</ItemGroup>
155+
</Project>

0 commit comments

Comments
 (0)