diff --git a/src/NVML.sln b/src/NVML.sln
index 3741be5fff8625e5e59f32bd8cadf53f5cc972b5..5bbafdb5662de8115d98b066d112bd293a85b81d 100644
--- a/src/NVML.sln
+++ b/src/NVML.sln
@@ -417,6 +417,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blk_pool", "test\blk_pool\b
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windows", "Windows", "{95FAF291-03D1-42FC-9C10-424D551D475D}"
+ ProjectSection(SolutionItems) = preProject
+ common\common.rc = common\common.rc
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pmem_movnt", "test\pmem_movnt\pmem_movnt.vcxproj", "{96D00A19-5CEF-4CC5-BDE8-E33C68BCE90F}"
EndProject
diff --git a/src/common/common.rc b/src/common/common.rc
new file mode 100644
index 0000000000000000000000000000000000000000..5d50641b9f785d8e31931b523d0f3fd8192151b9
--- /dev/null
+++ b/src/common/common.rc
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2016, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * common.h -- declarations of common functions
+ */
+
+#include <windows.h>
+#include "srcversion.h"
+
+#define VERSION(major, minor, build, revision) major, minor, build, revision
+
+#ifdef _DEBUG
+#define VERSION_DEBUG VS_FF_DEBUG
+#else
+#define VERSION_DEBUG 0
+#endif
+
+#ifdef PRERELEASE
+#define VERSION_PRERELEASE VS_FF_PRERELEASE
+#else
+#define VERSION_PRERELEASE 0
+#endif
+
+#ifdef BUGFIX
+#define VERSION_PATCHED VS_FF_PATCHED
+#else
+#define VERSION_PATCHED 0
+#endif
+
+#ifdef PRIVATE
+#define VERSION_PRIVATE VS_FF_PRIVATE
+#else
+#define VERSION_PRIVATE 0
+#endif
+
+#ifdef CUSTOM
+#define VERSION_SPECIAL VS_FF_SPECIALBUILD
+#else
+#define VERSION_SPECIAL 0
+#endif
+
+#define VERSION_PRIVATEBUILD VS_FF_PRIVATEBUILD
+#define VER_PATCHED VS_FF_PATCHED
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION VERSION(MAJOR, MINOR, BUILD, REVISION)
+PRODUCTVERSION VERSION(MAJOR, MINOR, BUILD, REVISION)
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS (VERSION_PRIVATEBUILD | VERSION_PRERELEASE | VERSION_DEBUG | VERSION_SPECIAL | VERSION_PATCHED)
+FILEOS VOS__WINDOWS32
+FILETYPE TYPE
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Intel"
+ VALUE "FileDescription", DESCRIPTION
+ VALUE "FileVersion", SRCVERSION
+ VALUE "InternalName", "NVML"
+ VALUE "LegalCopyright", "Copyright 2014-2016, Intel Corporation"
+ VALUE "OriginalFilename", FILE_NAME
+ VALUE "ProductName", "NVM Library"
+ VALUE "ProductVersion", SRCVERSION
+#if VERSION_SPECIAL == VS_FF_SPECIALBUILD
+ VALUE "SpecialBuild", VERSION_CUSTOM_MSG
+#endif
+#if VERSION_PRIVATEBUILD == VS_FF_SPECIALBUILD
+ VALUE "PrivateBuild", "Not a release build"
+#endif
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* XXX: Update to UNICODE */
+ VALUE "Translation", 0x409, 0
+ END
+END
diff --git a/src/libpmem/libpmem.rc b/src/libpmem/libpmem.rc
new file mode 100644
index 0000000000000000000000000000000000000000..23b4e3280b52f59f77d530574f77ce4d9e2bd3db
--- /dev/null
+++ b/src/libpmem/libpmem.rc
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * libpmem.rc -- libpmem resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmem.dll"
+#define DESCRIPTION "libpmem - persistent memory support library"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/src/libpmem/libpmem.vcxproj b/src/libpmem/libpmem.vcxproj
index 66cf89463b10257a43c5cf9eee3498ca6ac808cc..ddb40aaaf0b8d443dff28f0cb6e2e7bd5e41ec10 100644
--- a/src/libpmem/libpmem.vcxproj
+++ b/src/libpmem/libpmem.vcxproj
@@ -39,6 +39,9 @@
<Project>{b3ff772d-f2ff-4e6e-abd8-763407bb6a5c}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmem.rc" />
+ </ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{9e9e3d25-2139-4a5d-9200-18148ddead45}</ProjectGuid>
<Keyword>DynamicLibrary</Keyword>
@@ -78,13 +81,13 @@
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(SolutionDir)\common;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
+ <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(SolutionDir)\common;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
- <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(SolutionDir)\common;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
+ <IncludePath>$(SolutionDir)\include;$(SolutionDir)\windows\include;$(SolutionDir)\common;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@@ -118,6 +121,11 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -145,6 +153,10 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>
+ </AdditionalIncludeDirectories>
+ </ResourceCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/src/libpmem/libpmem.vcxproj.filters b/src/libpmem/libpmem.vcxproj.filters
index 1897bec94699a0fc0838d2bff29928e2b2afccf8..af6a1c2e599b85a8787f6b09e2b90a1ad55e0838 100644
--- a/src/libpmem/libpmem.vcxproj.filters
+++ b/src/libpmem/libpmem.vcxproj.filters
@@ -61,4 +61,9 @@
<Filter>Source Files</Filter>
</None>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmem.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project>
\ No newline at end of file
diff --git a/src/libpmemblk/libpmemblk.rc b/src/libpmemblk/libpmemblk.rc
new file mode 100644
index 0000000000000000000000000000000000000000..6bfa6c7f0ff20594f211119d74ae6fac873eba09
--- /dev/null
+++ b/src/libpmemblk/libpmemblk.rc
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * libpmemblk.rc -- libpmemblk resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmemblk.dll"
+#define DESCRIPTION "libpmemblk - persistent memory resident array of blocks"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/src/libpmemblk/libpmemblk.vcxproj b/src/libpmemblk/libpmemblk.vcxproj
index 4e19e32ed427cb2daea55aa47392f111906980aa..d6eb9353d63dc94386c46095b07ea0542c4c10a1 100644
--- a/src/libpmemblk/libpmemblk.vcxproj
+++ b/src/libpmemblk/libpmemblk.vcxproj
@@ -39,6 +39,9 @@
<Project>{b3ff772d-f2ff-4e6e-abd8-763407bb6a5c}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmemblk.rc" />
+ </ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{f7c6c6b6-4142-4c82-8699-4a9d8183181b}</ProjectGuid>
<Keyword>DynamicLibrary</Keyword>
@@ -114,6 +117,9 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
diff --git a/src/libpmemblk/libpmemblk.vcxproj.filters b/src/libpmemblk/libpmemblk.vcxproj.filters
index ddbdb73c4c65997772b6e796b6209a377dc241b6..10e00fe52512e30225b2ecc699cb4ff65edebbf7 100644
--- a/src/libpmemblk/libpmemblk.vcxproj.filters
+++ b/src/libpmemblk/libpmemblk.vcxproj.filters
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Header Files">
@@ -50,4 +50,9 @@
<Filter>Source Files</Filter>
</None>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmemblk.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project>
\ No newline at end of file
diff --git a/src/libpmemlog/libpmemlog.rc b/src/libpmemlog/libpmemlog.rc
new file mode 100644
index 0000000000000000000000000000000000000000..6f03ded88ca94025bc076a67f3658aed422e12c8
--- /dev/null
+++ b/src/libpmemlog/libpmemlog.rc
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * libpmemlog.rc -- libpmemlog resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmemlog.dll"
+#define DESCRIPTION "libpmemlog - persistent memory resident log file"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/src/libpmemlog/libpmemlog.vcxproj b/src/libpmemlog/libpmemlog.vcxproj
index 7d24a188ac7a0005e46bb82f6467a8d5234e0172..c99e96f5b4d9c5ed6de700becdd043ea188771ab 100644
--- a/src/libpmemlog/libpmemlog.vcxproj
+++ b/src/libpmemlog/libpmemlog.vcxproj
@@ -36,6 +36,9 @@
<Project>{b3ff772d-f2ff-4e6e-abd8-763407bb6a5c}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmemlog.rc" />
+ </ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0B1818EB-BDC8-4865-964F-DB8BF05CFD86}</ProjectGuid>
<Keyword>DynamicLibrary</Keyword>
@@ -111,6 +114,9 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
diff --git a/src/libpmemlog/libpmemlog.vcxproj.filters b/src/libpmemlog/libpmemlog.vcxproj.filters
index e68496c7a57ea7787d051529b3951894777d92e4..7fc5088a7eecc2f262eade39479381d0b6e4fbe6 100644
--- a/src/libpmemlog/libpmemlog.vcxproj.filters
+++ b/src/libpmemlog/libpmemlog.vcxproj.filters
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\src\libpmemlog\libpmemlog.c">
@@ -41,4 +41,9 @@
<Filter>Source Files</Filter>
</None>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmemlog.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project>
\ No newline at end of file
diff --git a/src/libpmemobj/libpmemobj.rc b/src/libpmemobj/libpmemobj.rc
new file mode 100644
index 0000000000000000000000000000000000000000..05239beb1098dad32284d8ebe2e04d7e3011963e
--- /dev/null
+++ b/src/libpmemobj/libpmemobj.rc
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * libpmemobj.rc -- libpmemobj resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmemobj.dll"
+#define DESCRIPTION "libpmemobj - persistent memory transactional object store"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/src/libpmemobj/libpmemobj.vcxproj b/src/libpmemobj/libpmemobj.vcxproj
index d54d1e17f0a8845b7691e582f18a8cb60d55d31a..408efa58199e3063b0d003c6342e2d9d1f1884bd 100644
--- a/src/libpmemobj/libpmemobj.vcxproj
+++ b/src/libpmemobj/libpmemobj.vcxproj
@@ -87,6 +87,9 @@
<Project>{b3ff772d-f2ff-4e6e-abd8-763407bb6a5c}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmemobj.rc" />
+ </ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1BAA1617-93AE-4196-8A1A-BD492FB18AEF}</ProjectGuid>
<Keyword>DynamicLibrary</Keyword>
@@ -163,6 +166,9 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
diff --git a/src/libpmemobj/libpmemobj.vcxproj.filters b/src/libpmemobj/libpmemobj.vcxproj.filters
index ccf89aeecfd09052841a7811f0128f511539de45..310d7805ff61c6de46e7278273de1b0a71a0303e 100644
--- a/src/libpmemobj/libpmemobj.vcxproj.filters
+++ b/src/libpmemobj/libpmemobj.vcxproj.filters
@@ -199,4 +199,9 @@
<Filter>Source Files</Filter>
</None>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmemobj.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project>
\ No newline at end of file
diff --git a/src/libpmempool/libpmempool.rc b/src/libpmempool/libpmempool.rc
new file mode 100644
index 0000000000000000000000000000000000000000..cc958259a601259eec394b536ec43d5f47bd2494
--- /dev/null
+++ b/src/libpmempool/libpmempool.rc
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016, Intel Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * Neither the name of the copyright holder nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * libpmempool.rc -- libpmempool resource file
+ */
+
+#include <windows.h>
+#define FILE_NAME "libpmempool.dll"
+#define DESCRIPTION "libpmempool - pool management library"
+#define TYPE VFT_DLL
+#include <common.rc>
\ No newline at end of file
diff --git a/src/libpmempool/libpmempool.vcxproj b/src/libpmempool/libpmempool.vcxproj
index 2b65ff605f4c2c00d46643e0e8195b96c72cf645..acd7a10ae7bd8aea1ecd370797aac51b449c5ab4 100644
--- a/src/libpmempool/libpmempool.vcxproj
+++ b/src/libpmempool/libpmempool.vcxproj
@@ -63,6 +63,9 @@
<Project>{b3ff772d-f2ff-4e6e-abd8-763407bb6a5c}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmempool.rc" />
+ </ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{CF9A0883-6334-44C7-AC29-349468C78E27}</ProjectGuid>
<Keyword>DynamicLibrary</Keyword>
@@ -144,6 +147,9 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
diff --git a/src/libpmempool/libpmempool.vcxproj.filters b/src/libpmempool/libpmempool.vcxproj.filters
index 054e2f1f1f806dff7ba1df1154aa086d3d5abd74..9257f78de21a1471af22c12f6fea4d777ef1374b 100644
--- a/src/libpmempool/libpmempool.vcxproj.filters
+++ b/src/libpmempool/libpmempool.vcxproj.filters
@@ -101,4 +101,9 @@
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="libpmempool.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
</Project>
\ No newline at end of file
diff --git a/src/tools/pmempool/pmempool.rc b/src/tools/pmempool/pmempool.rc
new file mode 100644
index 0000000000000000000000000000000000000000..b29dacb206104417605c67c8fa84ff0754a5fdc4
Binary files /dev/null and b/src/tools/pmempool/pmempool.rc differ
diff --git a/src/tools/pmempool/pmempool.vcxproj b/src/tools/pmempool/pmempool.vcxproj
index 8fa5d8933eed395fc9d941b7fa4bfba4c29ff2c7..414b8cb472ca0b1c9031d3a66ab243694765e646 100644
--- a/src/tools/pmempool/pmempool.vcxproj
+++ b/src/tools/pmempool/pmempool.vcxproj
@@ -87,6 +87,9 @@
<Project>{b3ff772d-f2ff-4e6e-abd8-763407bb6a5c}</Project>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="pmempool.rc" />
+ </ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7DC3B3DD-73ED-4602-9AF3-8D7053620DEA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
@@ -145,6 +148,9 @@
<Command>
</Command>
</PreBuildEvent>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG</PreprocessorDefinitions>
+ </ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -171,4 +177,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
diff --git a/src/tools/pmempool/pmempool.vcxproj.filters b/src/tools/pmempool/pmempool.vcxproj.filters
index 8e2c33c920f046049a910df89703d23210466bcc..ccae1a8647e1bfb9ecd80810e1c7ede9df628909 100644
--- a/src/tools/pmempool/pmempool.vcxproj.filters
+++ b/src/tools/pmempool/pmempool.vcxproj.filters
@@ -155,4 +155,9 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
-</Project>
+ <ItemGroup>
+ <ResourceCompile Include="pmempool.rc">
+ <Filter>Source Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/utils/SRCVERSION.ps1 b/utils/SRCVERSION.ps1
index 32dcba50279368dca56965ee749a622e612037bc..6ae9ad97f08072e634fedce10589c52e7b5bb2e3 100644
--- a/utils/SRCVERSION.ps1
+++ b/utils/SRCVERSION.ps1
@@ -32,23 +32,106 @@
# SRCVERSION.PS1 -- script to create SCRVERSION macro on windows
#
+#
+# Expected Values:
+# +--------------------+-----+-----+-----+--------+------+-------+----------+
+# |git describe --long |MAJOR|MINOR|BUILD|REVISION|BUGFIX|PRIVATE|PRERELEASE|
+# +--------------------+-----+-----+-----+--------+------+-------+----------+
+# |1.2-0-12345678 | 1| 2| 0| 1000| false| false| false|
+# |1.2-32-123345678 | 1| 2| 32| 1000| false| true| false|
+# |1.2-rc2-0-12345678 | 1| 2| 0| 2| false| false| true|
+# |1.2-rc3-32-12345678 | 1| 2| 32| 3| false| true| true|
+# |1.2+b3-0-12345678 | 1| 2| 0| 1003| true| false| false|
+# |1.2+b2-327-12345678 | 1| 2| 327| 1002| true| true| false|
+# +--------------------+-----+-----+-----+--------+------+-------+----------+
+#
+
$scriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition
$file_path = $scriptPath + "\..\src\windows\include\srcversion.h"
$git = Get-Command -Name git -ErrorAction SilentlyContinue
if (Test-Path $file_path) {
- $old_version = Get-Content $file_path | Where-Object { $_ -like '#define*' }
+ $old_src_version = Get-Content $file_path | Where-Object { $_ -like '#define SRCVERSION*' }
} else {
- $old_version = ""
+ $old_src_version = ""
}
-
+ $PRERELEASE = $false
+ $BUGFIX = $false
+ $PRIVATE = $true
+ $CUSTOM = $false
if ($git -eq $null) {
- $version = "#define SRCVERSION `"1.0`""
+ $MAJOR = 0
+ $MINOR = 0
+ $REVISION = 0
+ $BUILD = 0
+
+ $CUSTOM = $true
+ $version_custom_msg = "#define VERSION_CUSTOM_MSG `"UNKNOWN VERSION`" "
} else {
- $version = "#define SRCVERSION `"$(git describe)`""
+ $version = $(git describe)
+ $no_git = $false
+ $ver_array = $(git describe --long).split("-")
+ if($ver_array.length -eq 4) {
+ # <MAJOR>.<MINOR>-RC<REVISION>-<BUILDNUMBER>-<HASH>
+ $MAJOR = $ver_array[0].split(".")[0]
+ $MINOR = $ver_array[0].split(".")[1]
+ $REVISION = $ver_array[1].Substring("rc".Length)
+ $BUILD = $ver_array[2]
+ $PRERELEASE = $true
+ } elseif($ver_array.length -eq 3) {
+
+ if($ver_array[0].split("+").Length -gt 1) {
+ # <MAJOR>.<MINOR>+b<REVISION>-<BUILDNUMBER>-<HASH>
+ $MAJOR = $ver_array[0].split("+")[0].split(".")[0]
+ $MINOR = $ver_array[0].split("+")[0].split(".")[1]
+ $REVISION = 1000 + $ver_array[0].split("+")[1].Substring("b".Length)
+ $BUILD = $ver_array[1]
+ $BUGFIX = $true
+ } else {
+ # <MAJOR>.<MINOR>-<BUILDNUMBER>-<HASH>
+ $MAJOR = $ver_array[0].split(".")[0]
+ $MINOR = $ver_array[0].split(".")[1]
+ $REVISION = 1000
+ $BUILD = $ver_array[1]
+ }
+ }
+
+ if($BUILD -eq 0 ) {
+ # it is not a (pre)release build
+ $PRIVATE = $false
+ }
}
+$src_version = "#define SRCVERSION `"$version`""
-if ($old_version -ne $version) {
- echo "updating source version: $version"
- echo $version > $file_path
+if ($old_src_version -eq $src_version) {
+ exit 0
}
+
+echo "updating source version: $version"
+echo $src_version > $file_path
+
+echo "#ifdef RC_INVOKED" >> $file_path
+
+echo "#define MAJOR $MAJOR" >> $file_path
+echo "#define MINOR $MINOR" >> $file_path
+echo "#define REVISION $REVISION" >> $file_path
+echo "#define BUILD $BUILD" >> $file_path
+
+if($PRERELEASE) {
+ echo "#define PRERELEASE 1" >> $file_path
+}
+if($BUGFIX) {
+ echo "#define BUGFIX 1" >> $file_path
+}
+if($PRIVATE) {
+ echo "#define PRIVATE 1" >> $file_path
+}
+if($CUSTOM) {
+ echo "#define CUSTOM 1" >> $file_path
+ echo $version_custom_msg >> $file_path
+}
+
+echo "#endif" >> $file_path
+
+
+