Skip to content

[TF2/ALL] Temporary workaround for debug build of libprotobuf corrupting data (on MSVC). #1303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/game/protobuf_include.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,33 @@ $Project
$Libexternal $SRCDIR\thirdparty\protobuf-2.6.1\bin\linux64\libprotobuf [$LINUX64]
}

// Currently there's an issue with debug build of libprotobuf not playing nice with the GCSDK on the Source SDK 2013 public repository.
// To get around this temporarily, we'll just compile against the release build of libprotobuf since we don't ship (most of) the thirdparty code anyway.
// ... However this causes the iterator debug level mismatch linker error (LNK2038) to come back to haunt us,
// so on the Public SDK we'll just have to disable iterator debugging completely for now.

$Folder "Link Libraries"
{
$File "$SRCDIR\thirdparty\protobuf-2.6.1\bin\win32\2015\staticcrt\release\libprotobuf.lib" [$WIN32]
{
$Configuration "Debug" { $ExcludedFromBuild "Yes" }
$Configuration "Debug"
{
$ExcludedFromBuild "Yes" [!$SOURCESDK]
}
}
$File "$SRCDIR\thirdparty\protobuf-2.6.1\bin\win32\2015\staticcrt\debug\libprotobuf.lib" [$WIN32]
$File "$SRCDIR\thirdparty\protobuf-2.6.1\bin\win32\2015\staticcrt\debug\libprotobuf.lib" [$WIN32 && !$SOURCESDK]
{
$Configuration "Release" { $ExcludedFromBuild "Yes" }
}

$File "$SRCDIR\thirdparty\protobuf-2.6.1\bin\win64\2015\staticcrt\release\libprotobuf.lib" [$WIN64]
{
$Configuration "Debug" { $ExcludedFromBuild "Yes" }
$Configuration "Debug"
{
$ExcludedFromBuild "Yes" [!$SOURCESDK]
}
}
$File "$SRCDIR\thirdparty\protobuf-2.6.1\bin\win64\2015\staticcrt\debug\libprotobuf.lib" [$WIN64]
$File "$SRCDIR\thirdparty\protobuf-2.6.1\bin\win64\2015\staticcrt\debug\libprotobuf.lib" [$WIN64 && !$SOURCESDK]
{
$Configuration "Release" { $ExcludedFromBuild "Yes" }
}
Expand Down
3 changes: 3 additions & 0 deletions src/vpc_scripts/source_dll_win32_debug.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ $Configuration "Debug"

// Preprocessor
$PreprocessorDefinitions "$BASE;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)"

// See comment in src/game/protobuf_include.vpc why we have to do this for now.
$PreprocessorDefinitions "$BASE;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ITERATOR_DEBUG_LEVEL=0" [$SOURCESDK]
$IgnoreStandardIncludePath
$GeneratePreprocessedFile
$KeepComments
Expand Down
3 changes: 3 additions & 0 deletions src/vpc_scripts/source_lib_win32_debug.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ $Configuration "Debug"

// Preprocessor
$PreprocessorDefinitions "$BASE;WIN32;_WIN32;_DEBUG;DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)"

// See comment in src/game/protobuf_include.vpc why we have to do this for now.
$PreprocessorDefinitions "$BASE;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ITERATOR_DEBUG_LEVEL=0" [$SOURCESDK]
$IgnoreStandardIncludePath
$GeneratePreprocessedFile
$KeepComments
Expand Down