Browse Source

Fix an VPC error related to GUID for VS2019 project

windows
JusicP 2 years ago
parent
commit
38ad2399ed
  1. BIN
      devtools/bin/vpc.exe
  2. 2
      external/vpc/tier0/threadtools.cpp
  3. 35
      external/vpc/utils/vpc/main.cpp
  4. 13
      external/vpc/utils/vpc/solutiongenerator_win32.cpp
  5. 2
      external/vpc/utils/vpc/vpc.h
  6. 21
      external/vpc/utils/vpc/vpc.vcxproj
  7. 3
      external/vpc/utils/vpc/vpc.vcxproj.filters

BIN
devtools/bin/vpc.exe

Binary file not shown.

2
external/vpc/tier0/threadtools.cpp vendored

@ -49,7 +49,7 @@
#endif #endif
#ifndef _PS3 #ifndef _PS3
#include <memory.h> #include <memory>
#endif #endif
#include "tier0/threadtools.h" #include "tier0/threadtools.h"

35
external/vpc/utils/vpc/main.cpp vendored

@ -75,7 +75,7 @@ CVPC::CVPC()
} }
#ifdef WIN32 #ifdef WIN32
m_eVSVersion = k_EVSVersion_2015; m_eVSVersion = k_EVSVersion_2019;
m_bUseVS2010FileFormat = true; m_bUseVS2010FileFormat = true;
m_bUseUnity = false; m_bUseUnity = false;
#else #else
@ -175,11 +175,6 @@ void CVPC::Shutdown( bool bHasError )
UnloadPerforceInterface(); UnloadPerforceInterface();
} }
#if defined( STANDALONE_VPC )
class CP4;
extern CP4 s_p4;
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CVPC::LoadPerforceInterface() bool CVPC::LoadPerforceInterface()
@ -190,11 +185,6 @@ bool CVPC::LoadPerforceInterface()
return true; return true;
} }
#if defined( STANDALONE_VPC )
p4 = (IP4*)&s_p4;
return (p4 != NULL);
#else
// //
// Try to load p4lib.dll and the filesystem since the p4lib relies on it // Try to load p4lib.dll and the filesystem since the p4lib relies on it
// //
@ -234,7 +224,6 @@ bool CVPC::LoadPerforceInterface()
p4->Connect( Sys_GetFactory( m_pFilesystemModule ) ); p4->Connect( Sys_GetFactory( m_pFilesystemModule ) );
return true; return true;
#endif
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -635,7 +624,8 @@ void CVPC::SpewUsage( void )
Log_Msg( LOG_VPC, "[/srcctl]: Enable P4SCC source control integration - can also set environment variable VPC_SRCCTL to 1\n" ); Log_Msg( LOG_VPC, "[/srcctl]: Enable P4SCC source control integration - can also set environment variable VPC_SRCCTL to 1\n" );
#endif #endif
Log_Msg( LOG_VPC, "[/mirror]: <path> - Mirror output files to specified path. Used for A:B testing.\n" ); Log_Msg( LOG_VPC, "[/mirror]: <path> - Mirror output files to specified path. Used for A:B testing.\n" );
Log_Msg( LOG_VPC, "[/2015]: Generate projects and solutions for Visual Studio 2015 [default]\n" ); Log_Msg( LOG_VPC, "[/2019]: Generate projects and solutions for Visual Studio 2019 [default]\n" );
Log_Msg( LOG_VPC, "[/2015]: Generate projects and solutions for Visual Studio 2015\n" );
Log_Msg( LOG_VPC, "[/2013]: Generate projects and solutions for Visual Studio 2013\n" ); Log_Msg( LOG_VPC, "[/2013]: Generate projects and solutions for Visual Studio 2013\n" );
Log_Msg( LOG_VPC, "[/2012]: Generate projects and solutions for Visual Studio 2012\n" ); Log_Msg( LOG_VPC, "[/2012]: Generate projects and solutions for Visual Studio 2012\n" );
Log_Msg( LOG_VPC, "[/2010]: Generate projects and solutions for Visual Studio 2010\n" ); Log_Msg( LOG_VPC, "[/2010]: Generate projects and solutions for Visual Studio 2010\n" );
@ -1004,6 +994,11 @@ void CVPC::HandleSingleCommandLineArg( const char *pArg )
m_eVSVersion = k_EVSVersion_2015; m_eVSVersion = k_EVSVersion_2015;
m_ExtraOptionsCRCString += pArgName; m_ExtraOptionsCRCString += pArgName;
} }
else if ( !V_stricmp( pArgName, "2019" ) )
{
m_eVSVersion = k_EVSVersion_2019;
m_ExtraOptionsCRCString += pArgName;
}
else if ( !V_stricmp( pArgName, "nounity" ) ) else if ( !V_stricmp( pArgName, "nounity" ) )
{ {
m_bUseUnity = false; m_bUseUnity = false;
@ -1825,6 +1820,16 @@ void CVPC::SetMacrosAndConditionals()
// VS2010 is strictly win32/xbox360 // VS2010 is strictly win32/xbox360
switch ( m_eVSVersion ) switch ( m_eVSVersion )
{ {
case k_EVSVersion_2019:
m_ExtraOptionsCRCString += "VS2019";
SetConditional( "VS2019", true );
// temporarily allow VS2013 conditionals also as there are many. Will fix.
SetConditional( "VS2013", true );
m_bUseVS2010FileFormat = true;
break;
case k_EVSVersion_2015: case k_EVSVersion_2015:
m_ExtraOptionsCRCString += "VS2015"; m_ExtraOptionsCRCString += "VS2015";
SetConditional( "VS2015", true ); SetConditional( "VS2015", true );
@ -2362,7 +2367,9 @@ void CVPC::SetupGenerators()
{ {
// spew what we are generating // spew what we are generating
const char *pchLogLine = "Generating for Visual Studio 2005.\n"; const char *pchLogLine = "Generating for Visual Studio 2005.\n";
if ( m_eVSVersion == k_EVSVersion_2015 ) if ( m_eVSVersion == k_EVSVersion_2019 )
pchLogLine = "Generating for Visual Studio 2019.\n";
else if ( m_eVSVersion == k_EVSVersion_2015 )
pchLogLine = "Generating for Visual Studio 2015.\n"; pchLogLine = "Generating for Visual Studio 2015.\n";
else if ( m_eVSVersion == k_EVSVersion_2013 ) else if ( m_eVSVersion == k_EVSVersion_2013 )
pchLogLine = "Generating for Visual Studio 2013.\n"; pchLogLine = "Generating for Visual Studio 2013.\n";

13
external/vpc/utils/vpc/solutiongenerator_win32.cpp vendored

@ -27,6 +27,12 @@ class CSolutionGenerator_Win32 : public IBaseSolutionGenerator
public: public:
void GetVCPROJSolutionGUID( char (&szSolutionGUID)[256] ) void GetVCPROJSolutionGUID( char (&szSolutionGUID)[256] )
{ {
if ( g_pVPC->Is2019() )
{
V_strncpy( szSolutionGUID, "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", ARRAYSIZE(szSolutionGUID) );
return;
}
HKEY hKey; HKEY hKey;
int firstVer = 8; int firstVer = 8;
const int lastVer = 14; // Handle up to VS 14, AKA VS 2015 const int lastVer = 14; // Handle up to VS 14, AKA VS 2015
@ -114,7 +120,12 @@ public:
g_pVPC->VPCError( "Can't open %s for writing.", pSolutionFilename ); g_pVPC->VPCError( "Can't open %s for writing.", pSolutionFilename );
if ( g_pVPC->Is2015() ) if ( g_pVPC->Is2019() )
{
fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" );
fprintf( fp, "# Visual Studio Version 16\n" );
}
else if ( g_pVPC->Is2015() )
{ {
fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" ); // still on 12 fprintf( fp, "\xef\xbb\xbf\nMicrosoft Visual Studio Solution File, Format Version 12.00\n" ); // still on 12
fprintf( fp, "# Visual Studio 2015\n" ); fprintf( fp, "# Visual Studio 2015\n" );

2
external/vpc/utils/vpc/vpc.h vendored

@ -182,6 +182,7 @@ enum EVSVersion
k_EVSVersion_2012, k_EVSVersion_2012,
k_EVSVersion_2013, k_EVSVersion_2013,
k_EVSVersion_2015, k_EVSVersion_2015,
k_EVSVersion_2019,
}; };
class CVPC class CVPC
@ -218,6 +219,7 @@ public:
bool Is2012() { return m_eVSVersion == k_EVSVersion_2012; } // When this returns true so does Is2010() because of the file format similarities bool Is2012() { return m_eVSVersion == k_EVSVersion_2012; } // When this returns true so does Is2010() because of the file format similarities
bool Is2013() { return m_eVSVersion == k_EVSVersion_2013; } // When this returns true so does Is2010() because of the file format similarities bool Is2013() { return m_eVSVersion == k_EVSVersion_2013; } // When this returns true so does Is2010() because of the file format similarities
bool Is2015() { return m_eVSVersion == k_EVSVersion_2015; } // When this returns true so does Is2010() because of the file format similarities bool Is2015() { return m_eVSVersion == k_EVSVersion_2015; } // When this returns true so does Is2010() because of the file format similarities
bool Is2019() { return m_eVSVersion == k_EVSVersion_2019; } // When this returns true so does Is2010() because of the file format similarities
bool BUse2008() { return m_eVSVersion == k_EVSVersion_2008; } bool BUse2008() { return m_eVSVersion == k_EVSVersion_2008; }
bool IsDedicatedBuild() { return m_bDedicatedBuild; } bool IsDedicatedBuild() { return m_bDedicatedBuild; }
bool IsUnity() { return m_bUseUnity; } bool IsUnity() { return m_bUseUnity; }

21
external/vpc/utils/vpc/vpc.vcxproj vendored

@ -13,21 +13,21 @@
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{36C5F545-588F-4091-B480-89E03EDBDA93}</ProjectGuid> <ProjectGuid>{36C5F545-588F-4091-B480-89E03EDBDA93}</ProjectGuid>
<RootNamespace>vpc</RootNamespace> <RootNamespace>vpc</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v142</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
@ -58,9 +58,8 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>p4 edit ..\..\..\..\devtools\bin\vpc.exe &amp;&amp; copy /y $(TargetPath) ..\..\..\..\devtools\bin\vpc.exe <Command>
p4 edit ..\..\..\..\devtools\bin\vpc.pdb &amp;&amp; copy /y $(TargetDir)\vpc.pdb ..\..\..\..\devtools\bin\vpc.pdb </Command>
</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -83,14 +82,12 @@ p4 edit ..\..\..\..\devtools\bin\vpc.pdb &amp;&amp; copy /y $(TargetDir)\vpc.pdb
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
</Link> </Link>
<PostBuildEvent> <PostBuildEvent>
<Command>p4 edit ..\..\..\..\devtools\bin\vpc.exe &amp;&amp; copy /y $(TargetPath) ..\..\..\..\devtools\bin\vpc.exe <Command>
p4 edit ..\..\..\..\devtools\bin\vpc.pdb &amp;&amp; copy /y $(TargetDir)\vpc.pdb ..\..\..\..\devtools\bin\vpc.pdb </Command>
</Command>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\interfaces\interfaces.cpp" /> <ClCompile Include="..\..\interfaces\interfaces.cpp" />
<ClCompile Include="..\..\p4lib\p4.cpp" />
<ClCompile Include="..\..\tier0\assert_dialog.cpp" /> <ClCompile Include="..\..\tier0\assert_dialog.cpp" />
<ClCompile Include="..\..\tier0\commandline.cpp" /> <ClCompile Include="..\..\tier0\commandline.cpp" />
<ClCompile Include="..\..\tier0\cpu.cpp" /> <ClCompile Include="..\..\tier0\cpu.cpp" />

3
external/vpc/utils/vpc/vpc.vcxproj.filters vendored

@ -245,9 +245,6 @@
<ClCompile Include="solutiongenerator_codelite.cpp"> <ClCompile Include="solutiongenerator_codelite.cpp">
<Filter>VPC\Source Files</Filter> <Filter>VPC\Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\p4lib\p4.cpp">
<Filter>Dependencies\Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\tier0\mem_helpers.h"> <ClInclude Include="..\..\tier0\mem_helpers.h">

Loading…
Cancel
Save