From a0c29e7dd67abb15c74c85f07741784877edfdcd Mon Sep 17 00:00:00 2001 From: Joe Ludwig Date: Mon, 2 Sep 2013 11:39:10 -0700 Subject: General: * Fixed a variety of server browser issues with mods based on this SDK * Fixed many warnings on various platforms * Added source code for fgdlib and raytrace * Updated many source files with the latest shared source from TF2. OSX: * Added support for Xcode 4.6 * Switched OSX builds to use Xcode instead of makefiles * Moved libs from src/lib/osx32 to src/lib/public/osx32 or src/lib/common/osx32 to match windows better. Linux: * Moved libs from src/lib/linux32 to src/lib/public/linux32 or src/lib/common/linux32 to match windows better. --- sp/src/vpc_scripts/definitions/win32_2010.def | 7 +- sp/src/vpc_scripts/groups.vgc | 3 + sp/src/vpc_scripts/platform_dirs.vpc | 5 + sp/src/vpc_scripts/projects.vgc | 10 ++ sp/src/vpc_scripts/protobuf_builder.vpc | 2 +- sp/src/vpc_scripts/source_base.vpc | 29 +++++ sp/src/vpc_scripts/source_dll_base.vpc | 37 ++++--- sp/src/vpc_scripts/source_dll_linux_base.vpc | 27 ++++- sp/src/vpc_scripts/source_dll_posix_base.vpc | 9 +- sp/src/vpc_scripts/source_dll_qt_base.vpc | 44 ++++++++ sp/src/vpc_scripts/source_dll_win32_base.vpc | 122 +++++++-------------- sp/src/vpc_scripts/source_dll_win32_debug.vpc | 52 +++++---- sp/src/vpc_scripts/source_dll_win32_release.vpc | 74 +++++++++---- sp/src/vpc_scripts/source_exe_base.vpc | 27 +++-- sp/src/vpc_scripts/source_exe_con_base.vpc | 18 +++ sp/src/vpc_scripts/source_exe_con_win32_base.vpc | 2 + sp/src/vpc_scripts/source_exe_posix_base.vpc | 29 +++-- sp/src/vpc_scripts/source_exe_qt_base.vpc | 5 + sp/src/vpc_scripts/source_exe_qt_con_base.vpc | 16 +++ sp/src/vpc_scripts/source_exe_qt_win32_base.vpc | 48 ++++++++ sp/src/vpc_scripts/source_exe_win_win32_base.vpc | 108 +++++++----------- sp/src/vpc_scripts/source_exe_win_win32_debug.vpc | 43 ++++---- .../vpc_scripts/source_exe_win_win32_release.vpc | 69 ++++++++---- sp/src/vpc_scripts/source_lib_base.vpc | 34 +++--- sp/src/vpc_scripts/source_lib_posix_base.vpc | 17 +-- sp/src/vpc_scripts/source_lib_qt_base.vpc | 2 + sp/src/vpc_scripts/source_lib_qt_win32_base.vpc | 22 ++++ sp/src/vpc_scripts/source_lib_win32_base.vpc | 39 +++---- sp/src/vpc_scripts/source_lib_win32_debug.vpc | 28 +++-- sp/src/vpc_scripts/source_lib_win32_release.vpc | 44 +++++--- sp/src/vpc_scripts/source_linux_base_project.vpc | 37 +++---- sp/src/vpc_scripts/source_mll_qt_base.vpc | 35 ++++++ sp/src/vpc_scripts/source_posix_base.vpc | 55 +++++----- sp/src/vpc_scripts/source_video_base.vpc | 46 +++----- sp/src/vpc_scripts/source_win32_base.vpc | 45 ++++---- sp/src/vpc_scripts/version.vpc | 2 +- 36 files changed, 729 insertions(+), 463 deletions(-) create mode 100644 sp/src/vpc_scripts/platform_dirs.vpc create mode 100644 sp/src/vpc_scripts/source_dll_qt_base.vpc create mode 100644 sp/src/vpc_scripts/source_exe_con_base.vpc create mode 100644 sp/src/vpc_scripts/source_exe_qt_base.vpc create mode 100644 sp/src/vpc_scripts/source_exe_qt_con_base.vpc create mode 100644 sp/src/vpc_scripts/source_exe_qt_win32_base.vpc create mode 100644 sp/src/vpc_scripts/source_lib_qt_base.vpc create mode 100644 sp/src/vpc_scripts/source_lib_qt_win32_base.vpc create mode 100644 sp/src/vpc_scripts/source_mll_qt_base.vpc (limited to 'sp/src/vpc_scripts') diff --git a/sp/src/vpc_scripts/definitions/win32_2010.def b/sp/src/vpc_scripts/definitions/win32_2010.def index 6d28d562..96d78d22 100644 --- a/sp/src/vpc_scripts/definitions/win32_2010.def +++ b/sp/src/vpc_scripts/definitions/win32_2010.def @@ -232,7 +232,12 @@ { "type" "ignore" } - + + "$AdditionalLibraryDirectories" + { + "type" "ignore" + } + // General "$AdditionalIncludeDirectories" { diff --git a/sp/src/vpc_scripts/groups.vgc b/sp/src/vpc_scripts/groups.vgc index c4786f55..f2784d6b 100644 --- a/sp/src/vpc_scripts/groups.vgc +++ b/sp/src/vpc_scripts/groups.vgc @@ -18,6 +18,7 @@ $Group "game" { "client" "mathlib" + "raytrace" "server" "tier1" "vgui_controls" @@ -32,6 +33,7 @@ $Group "everything" { "captioncompiler" "client" + "fgdlib" "game_shader_dx9" "glview" "height2normal" @@ -39,6 +41,7 @@ $Group "everything" "motionmapper" "phonemeextractor" "qc_eyes" + "raytrace" "server" "serverplugin_empty" "tgadiff" diff --git a/sp/src/vpc_scripts/platform_dirs.vpc b/sp/src/vpc_scripts/platform_dirs.vpc new file mode 100644 index 00000000..f19b8a20 --- /dev/null +++ b/sp/src/vpc_scripts/platform_dirs.vpc @@ -0,0 +1,5 @@ +$Macro PLATSUBDIR "\." [$WIN32] +$Macro PLATSUBDIR "\x64" [$WIN64] +$Macro PLATSUBDIR "\." [$X360] +$Macro PLATSUBDIR "\linux32" [$LINUX32] +$Macro PLATSUBDIR "\osx32" [$OSX32] diff --git a/sp/src/vpc_scripts/projects.vgc b/sp/src/vpc_scripts/projects.vgc index ff17a9d5..3c57e865 100644 --- a/sp/src/vpc_scripts/projects.vgc +++ b/sp/src/vpc_scripts/projects.vgc @@ -19,6 +19,11 @@ $Project "client" "game\client\client_episodic.vpc" [($WIN32||$X360||$POSIX) && $EPISODIC] } +$Project "fgdlib" +{ + "fgdlib\fgdlib.vpc" [$WIN32] +} + $Project "game_shader_dx9" { "materialsystem\stdshaders\game_shader_dx9_hl2.vpc" [$HL2] @@ -56,6 +61,11 @@ $Project "phonemeextractor" "utils\phonemeextractor\phonemeextractor.vpc" [$WIN32] } +$Project "raytrace" +{ + "raytrace\raytrace.vpc" [$WIN32||$X360||$POSIX] +} + $Project "qc_eyes" { "utils\qc_eyes\qc_eyes.vpc" [$WIN32] diff --git a/sp/src/vpc_scripts/protobuf_builder.vpc b/sp/src/vpc_scripts/protobuf_builder.vpc index 518aeafb..a0fd8667 100644 --- a/sp/src/vpc_scripts/protobuf_builder.vpc +++ b/sp/src/vpc_scripts/protobuf_builder.vpc @@ -9,7 +9,7 @@ $CustomBuildStep "proto" $CommandLine "mkdir $GENERATED_PROTO_DIR 2> /dev/null;" \ "$SRCDIR/devtools/bin/osx32/protoc --proto_path=$SRCDIR\thirdparty\protobuf-2.3.0\src --proto_path=$(InputDir) --proto_path=$SRCDIR\gcsdk --cpp_out=$GENERATED_PROTO_DIR $(InputPath)" [$OSXALL] $CommandLine "mkdir $GENERATED_PROTO_DIR 2> /dev/null;" \ - "$SRCDIR/gcsdk/bin/linux/protoc --proto_path=$SRCDIR\thirdparty\protobuf-2.3.0\src --proto_path=$(InputDir) --proto_path=$SRCDIR\gcsdk --cpp_out=$GENERATED_PROTO_DIR $(InputPath)" [$LINUX] + "$SRCDIR/gcsdk/bin/linux/protoc --proto_path=$SRCDIR\thirdparty\protobuf-2.3.0\src --proto_path=$(InputDir) --proto_path=$SRCDIR\gcsdk --cpp_out=$GENERATED_PROTO_DIR $(InputPath)" [$LINUXALL] $Outputs "$GENERATED_PROTO_DIR\$(InputName).pb.cc;$GENERATED_PROTO_DIR\$(InputName).pb.h" } diff --git a/sp/src/vpc_scripts/source_base.vpc b/sp/src/vpc_scripts/source_base.vpc index fc70c2e5..86722a3a 100644 --- a/sp/src/vpc_scripts/source_base.vpc +++ b/sp/src/vpc_scripts/source_base.vpc @@ -15,3 +15,32 @@ // rel/tf_beta branch: //$Conditional TF_BETA "1" +$Configuration "Debug" +{ + $Compiler + { + // Pass on appropriate branch define to preprocessor + $PreprocessorDefinitions "VPC" + $PreprocessorDefinitions "$BASE;STAGING_ONLY" [$STAGING_ONLY] + $PreprocessorDefinitions "$BASE;TF_BETA" [$TF_BETA] + $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] +// Need to revisit the code to make things run with the _RETAIL preprocessor definition +// This line was added in the previous check-in, but had previously not been defined in this branch +// $PreprocessorDefinitions "$BASE;_RETAIL" [$RETAIL] + } +} + +$Configuration "Release" +{ + $Compiler + { + // Pass on appropriate branch define to preprocessor + $PreprocessorDefinitions "VPC" + $PreprocessorDefinitions "$BASE;STAGING_ONLY" [$STAGING_ONLY] + $PreprocessorDefinitions "$BASE;TF_BETA" [$TF_BETA] + $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] +// Need to revisit the code to make things run with the _RETAIL preprocessor definition +// This line was added in the previous check-in, but had previously not been defined in this branch +// $PreprocessorDefinitions "$BASE;_RETAIL" [$RETAIL] + } +} diff --git a/sp/src/vpc_scripts/source_dll_base.vpc b/sp/src/vpc_scripts/source_dll_base.vpc index b2c07984..c4b73b97 100644 --- a/sp/src/vpc_scripts/source_dll_base.vpc +++ b/sp/src/vpc_scripts/source_dll_base.vpc @@ -1,20 +1,25 @@ -//----------------------------------------------------------------------------- -// source_dll_base.VPC -// -// Project Script -//----------------------------------------------------------------------------- - +$MacroRequired "OUTDLLEXT" "$_DLL_EXT" +$Include "$SRCDIR\vpc_scripts\platform_dirs.vpc" $include "$SRCDIR\vpc_scripts\source_base.vpc" -$Macro PLATSUBDIR "\linux32" [$LINUX32] -$Macro PLATSUBDIR "\osx32" [$OSX32] -$Macro OUTBINDIR "$OUTBINDIR" [$LINUX32] -$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" [$LINUX32] -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [$LINUX32] - -$include "$SRCDIR\vpc_scripts\source_dll_win32_base.vpc" [$WINDOWS] -$include "$SRCDIR\vpc_scripts\source_dll_x360_base.vpc" [$X360] -$include "$SRCDIR\vpc_scripts\source_dll_posix_base.vpc" [$OSXALL] -$Include "$SRCDIR\vpc_scripts\source_dll_linux_base.vpc" [$LINUX] +$include "$SRCDIR\vpc_scripts\source_dll_posix_base.vpc" [$POSIX] +$Include "$SRCDIR\vpc_scripts\source_dll_win32_base.vpc" [( $WIN32 || $WIN64 ) && !$POSIX] +$Include "$SRCDIR\vpc_scripts\source_dll_x360_base.vpc" [$X360] +$Include "$SRCDIR\vpc_scripts\source_ppu_prx_ps3_base.vpc" [$PS3] $Include "$SRCDIR\vpc_scripts\source_video_base.vpc" +$Configuration +{ + $General [$VS2010] + { + $TargetExtension "$OUTDLLEXT" + } + + $Compiler + { + $PreprocessorDefinitions "$BASE;DEV_BUILD" [!$PUBLISH] + $PreprocessorDefinitions "$BASE;_PROFILE" [$PROFILE && !$RETAIL] + $PreprocessorDefinitions "$BASE;RETAIL_ASSERTS" [$RETAIL && $RETAILASSERTS] + $PreprocessorDefinitions "$BASE;FRAME_POINTER_OMISSION_DISABLED" [$NOFPO || $VS2010] + } +} diff --git a/sp/src/vpc_scripts/source_dll_linux_base.vpc b/sp/src/vpc_scripts/source_dll_linux_base.vpc index 18fb1f55..f82cb3e9 100644 --- a/sp/src/vpc_scripts/source_dll_linux_base.vpc +++ b/sp/src/vpc_scripts/source_dll_linux_base.vpc @@ -2,9 +2,8 @@ $Include "$SRCDIR\vpc_scripts\version.vpc" $Include "$SRCDIR\vpc_scripts\source_linux_base_project.vpc" - $MacroRequired "OUTBINNAME" "$PROJECTNAME" - +$MacroRequired "OUTBINDIR" "$SRCDIR\..\game\bin" // General configuration info. $Configuration @@ -12,7 +11,7 @@ $Configuration $General { $ConfigurationType "Dynamic Library (.dll)" - $OutputFile "$(OBJ_DIR)/$OUTBINNAME$_DLL_EXT" + $OutputFile "$(OBJ_DIR)/$OUTBINNAME$_DLL_EXT" $GameOutputFile "$OUTBINDIR/$OUTBINNAME$_DLL_EXT" } @@ -22,3 +21,25 @@ $Configuration } } +// Skeleton Project - All derived projects get this as a starting base +$Project +{ + $Folder "Source Files" + { + $File "$SRCDIR\public\tier0\memoverride.cpp" + { + $Configuration + { + $Compiler + { + $Create/UsePrecompiledHeader "Not Using Precompiled Headers" + } + } + } + } + + $Folder "Resources" + { + $File "$ROOTSCRIPT" + } +} diff --git a/sp/src/vpc_scripts/source_dll_posix_base.vpc b/sp/src/vpc_scripts/source_dll_posix_base.vpc index c7fc3e10..67040686 100644 --- a/sp/src/vpc_scripts/source_dll_posix_base.vpc +++ b/sp/src/vpc_scripts/source_dll_posix_base.vpc @@ -13,12 +13,17 @@ $Configuration $General { $ConfigurationType "Dynamic Library (.dll)" - $GameOutputFile "$OUTBINDIR/$OUTBINNAME$_DLL_EXT" + $GameOutputFile "$OUTBINDIR/$OUTBINNAME$OUTDLLEXT" + } + + $Compiler + { + $PreprocessorDefinitions "$BASE;DLLNAME=$OUTBINNAME" } $Linker { - $OutputFile "$(OBJ_DIR)/$OUTBINNAME$_DLL_EXT" + $OutputFile "$(OBJ_DIR)/$OUTBINNAME$OUTDLLEXT" } } diff --git a/sp/src/vpc_scripts/source_dll_qt_base.vpc b/sp/src/vpc_scripts/source_dll_qt_base.vpc new file mode 100644 index 00000000..cd2b994b --- /dev/null +++ b/sp/src/vpc_scripts/source_dll_qt_base.vpc @@ -0,0 +1,44 @@ +//===================== Copyright (c) Valve Corporation. All Rights Reserved. ====================== +// +//================================================================================================== + +$Macro QT_ROOT "$SRCDIR\thirdparty\lgpl\qt" + +$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" +$Include "$SRCDIR\vpc_scripts\qt_base.vpc" + +$Configuration +{ + $Compiler + { + $AdditionalIncludeDirectories "$BASE;.\;$SRCDIR\game\shared;$QT_ROOT\include;.\$QT_TARGET_SUBDIR" + $PreprocessorDefinitions "$BASE;QT_LARGEFILE_SUPPORT;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT" + $DisableSpecificWarnings "4127;4512;$BASE" + + // Causes a bunch of bogus compiler warnings for now; let's disable it + $Detect64bitPortabilityIssues "No" + } +} + +$Configuration "Release" +{ + $Compiler + { + $PreprocessorDefinitions "$BASE;QT_NO_DEBUG" + } +} + +$Project +{ + $Folder "Link Libraries" [$QTDEBUG] + { + $Lib "$QT_ROOT\lib\qtcored4" + $Lib "$QT_ROOT\lib\qtguid4" + } + + $Folder "Link Libraries" [!$QTDEBUG] + { + $Lib "$QT_ROOT\lib\qtcore4" + $Lib "$QT_ROOT\lib\qtgui4" + } +} diff --git a/sp/src/vpc_scripts/source_dll_win32_base.vpc b/sp/src/vpc_scripts/source_dll_win32_base.vpc index 4382efaa..cbd0a49a 100644 --- a/sp/src/vpc_scripts/source_dll_win32_base.vpc +++ b/sp/src/vpc_scripts/source_dll_win32_base.vpc @@ -6,26 +6,13 @@ $Include "$SRCDIR\vpc_scripts\version.vpc" -$Macro NOAPPENDPLATSUBDIR "1" [!$WIN64] - -$MacroRequired "PLATSUBDIR" $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" "$PROJECTNAME" $MacroRequired "OUTBINDIR" - -// These are convenient for adjusting directory paths based on platform -// but they must be used without absolute consistency to avoid dependency -// problems. It appears that if VPC compares $LIBPUBLIC to $SRCDIR\lib\public -// it will decide that they are not equal, even if the *value* of $LIBPUBLIC -// is $SRCDIR\lib\public. These macros can safely be used in copy commands -// and other areas that VPC doesn't use for dependency tracking. -$Macro LIBPUBLIC "$SRCDIR\lib\public" -$Macro LIBCOMMON "$SRCDIR\lib\common" - -// Fix up directories for targets like win64 -$Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR && !$NOMODIFYOUTBINDIR] -$Macro LIBPUBLIC "$LIBPUBLIC$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR] -$Macro LIBCOMMON "$LIBCOMMON$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR] + +$Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR" +$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" $Include "$SRCDIR\vpc_scripts\loadaddress.vpc" $Include "$SRCDIR\vpc_scripts\source_dll_win32_debug.vpc" @@ -34,75 +21,71 @@ $Include "$SRCDIR\vpc_scripts\source_win32_base.vpc" $IgnoreRedundancyWarning "ON" -$Linux -{ - -$File "$SRCDIR\lib\public\tier0.lib" - $file "$SRCDIR\linux\tier0_i686.so" - - -$File "$SRCDIR\lib\public\vstdlib.lib" [!$WIN64] - -$File "$SRCDIR\lib\public\$PLATFORM\vstdlib.lib" [$WIN64] - $file "$SRCDIR\linux\vstdlib_i686.so" -} - // Common Configuration $Configuration { - $General [$VS2010] + $General [$VS2010] + { + $TargetName "$OUTBINNAME" + } + + $Compiler { - $TargetName "$OUTBINNAME" + $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64] + $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32] + $PreprocessorDefinitions "$BASE;COMPILER_MSVC;_DLL_EXT=$_DLL_EXT" + $PreprocessorDefinitions "$BASE;DLLNAME=$OUTBINNAME" } + $Compiler [$WIN32] + { + $EnableEnhancedInstructionSet "Streaming SIMD Extensions 2 (/arch:SSE2)" + } + + $Linker + { + $AdditionalDependencies "$BASE shell32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib ole32.lib" [$WIN32||$WIN64] + $TargetMachine "MachineX86 (/MACHINE:X86)" [$WIN32] + $TargetMachine "MachineX64 (/MACHINE:X64)" [$WIN64] + // Suppress this pointless warning using the undocumented /ignore linker switch + // schemalib.lib(schemaclassinfo.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library + $AdditionalOptions "$BASE /ignore:4221" + } + $PreBuildEvent { $CommandLine "if EXIST $OUTBINDIR\$(TargetFileName) for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \ "set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \ "if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \ - "$CRCCHECK" [!$SOURCESDK] + "$CRCCHECK" "\n" } $PostBuildEvent [!$ANALYZE] { $CommandLine "if not exist $QUOTE$OUTBINDIR$QUOTE mkdir $QUOTE$OUTBINDIR$QUOTE" "\n" $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE $SRCDIR" "\n" [!$SOURCESDK] - $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetFileName) $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE" "\n" \ + $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$(TargetFileName)$QUOTE $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ - "if exist $QUOTE$(TargetDir)$QUOTE$(TargetName).map copy $QUOTE$(TargetDir)$QUOTE$(TargetName).map $OUTBINDIR\$(TargetName).map" "\n" - $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" [!$SOURCESDK] - $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetName).pdb $OUTBINDIR\$(TargetName).pdb" "\n" \ + "if exist $QUOTE$(TargetDir)$(TargetName).map$QUOTE copy $QUOTE$(TargetDir)$(TargetName).map$QUOTE $OUTBINDIR\$(TargetName).map" "\n" + $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $QUOTE$OUTBINDIR\$(TargetName).pdb$QUOTE $SRCDIR" "\n" [!$SOURCESDK] + $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$(TargetName).pdb$QUOTE $OUTBINDIR\$(TargetName).pdb" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "goto BuildEventOK" "\n" \ ":BuildEventFailed" "\n" \ "echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***" "\n" \ - "del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \ + "del /q $QUOTE$(TargetDir)$(TargetFileName)$QUOTE" "\n" \ "exit 1" "\n" \ - ":BuildEventOK" "\n" + ":BuildEventOK" "\n" $CommandLine "$BASE" "\n" \ - "call $SRCDIR\devtools\bin\vsign.bat -sign $OUTBINDIR\$(TargetFileName)" "\n" [$RETAIL && !$SOURCESDK] + "call $SRCDIR\devtools\bin\vsign.bat -sign $OUTBINDIR\$(TargetFileName)" "\n" [$RETAIL && $PUBLISH] $CommandLine "$BASE" "\n" \ - "call $SRCDIR\devtools\bin\vsign.bat -signvalve $OUTBINDIR\$(TargetFileName)" "\n" [!$RETAIL && !$SOURCESDK] + "call $SRCDIR\devtools\bin\vsign.bat -signvalve $OUTBINDIR\$(TargetFileName)" "\n" [!$RETAIL && !$PUBLISH && !$SOURCESDK] $Description "Publishing to $OUTBINDIR" $ExcludedFromBuild "No" } - - $Linker - { - // Suppress this warning using the undocumented /ignore linker switch - // schemalib.lib(schemaclassinfo.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library - $AdditionalOptions "$BASE /ignore:4221" - $AdditionalDependencies "%(AdditionalDependencies)" [$VS2010] - $TargetMachine "MachineX86 (/MACHINE:X86)" [$WIN32] - $TargetMachine "MachineX64 (/MACHINE:X64)" [$WIN64] - - // This option is from the devil. Basically, it causes the link inputs - // to vary depending on what is in the solution. This is anathema - // to the way that we use projects and solutions here at Valve. - // It also exposes a bug in VS2005 causing files to be recompiled/linked - // even if nothing changed. - $LinkLibraryDependencies "false" - } } // Skeleton Project - All derived projects get this as a starting base @@ -120,23 +103,6 @@ $Project } } } - - // Implement __imp__EncodePointer and __imp__DecodePointer so that we can run on XP SP1 - // when building with VS 2010. - $File "$SRCDIR\public\tier0\pointeroverride.asm" [$WIN32 && $VS2010] - { - $Configuration - { - $CustomBuildStep - { - // General - $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /safeseh /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" - $Description "Compiling pointeroverride.asm" - $Outputs "$(IntDir)\$(InputName).obj" - } - } - } - $File "$SRCDIR\common\debug_dll_check.cpp" [!$SOURCESDK] { $Configuration @@ -146,18 +112,14 @@ $Project $Create/UsePrecompiledHeader "Not Using Precompiled Headers" } } - } + } } $Folder "Link Libraries" { - $DynamicFile "$SRCDIR\lib\public\tier0.lib" [!$WIN64] - $DynamicFile "$SRCDIR\lib\public\tier1.lib" [!$WIN64] - $DynamicFile "$SRCDIR\lib\public\vstdlib.lib" [!$WIN64] - - $DynamicFile "$SRCDIR\lib\public\$PLATFORM\tier0.lib" [$WIN64] - $DynamicFile "$SRCDIR\lib\public\$PLATFORM\tier1.lib" [$WIN64] - $DynamicFile "$SRCDIR\lib\public\$PLATFORM\vstdlib.lib" [$WIN64] + $Implib "$LIBPUBLIC\tier0" + $Lib "$LIBPUBLIC\tier1" + $Implib "$LIBPUBLIC\vstdlib" } } diff --git a/sp/src/vpc_scripts/source_dll_win32_debug.vpc b/sp/src/vpc_scripts/source_dll_win32_debug.vpc index 5867cc9c..8d53aaf6 100644 --- a/sp/src/vpc_scripts/source_dll_win32_debug.vpc +++ b/sp/src/vpc_scripts/source_dll_win32_debug.vpc @@ -6,18 +6,26 @@ $IgnoreRedundancyWarning "ON" -$MacroRequired "PLATSUBDIR" $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" $MacroRequired "OUTBINDIR" +$MacroRequired "LIBPUBLIC" +$MacroRequired "LIBCOMMON" +$MacroRequired "PLATSUBDIR" +$MacroRequired "OUTDLLEXT" +$MacroRequiredAllowEmpty "GAMENAME" +$MacroRequiredAllowEmpty "INTERMEDIATESUBDIR" +$MacroRequiredAllowEmpty "_UNITYSUBDIR" +$Macro "_SUBDIRSUFFIX" "$INTERMEDIATESUBDIR$GAMENAME$PLATSUBDIR$_UNITYSUBDIR" $Configuration "Debug" { $General { // General - $OutputDirectory ".\Debug$PLATSUBDIR" - $IntermediateDirectory ".\Debug$PLATSUBDIR" + $OutputDirectory ".\Debug$_SUBDIRSUFFIX" + $IntermediateDirectory ".\Debug$_SUBDIRSUFFIX" + $ExtensionsToDeleteOnClean $BuildLogFile $InheritedProjectPropertySheets @@ -49,11 +57,10 @@ $Configuration "Debug" // General $AdditionalIncludeDirectories "$SRCDIR\common;$SRCDIR\public;$SRCDIR\public\tier0;$SRCDIR\public\tier1" $Resolve#UsingReferences - $DebugInformationFormat "Program Database for Edit & Continue (/ZI)" [!$EANDCDISABLED && !$WIN64] - $DebugInformationFormat "Program Database (/Zi)" [$EANDCDISABLED || $WIN64] + $DebugInformationFormat "Program Database for Edit & Continue (/ZI)" [$WIN32] + $DebugInformationFormat "Program Database (/Zi)" [$WIN64] $SuppressStartupBanner $WarningLevel "Level 4 (/W4)" - $Detect64bitPortabilityIssues "Yes (/Wp64)" $TreatWarningsAsErrors $UseUNICODEResponseFiles @@ -67,19 +74,14 @@ $Configuration "Debug" $WholeProgramOptimization // Preprocessor - $PreprocessorDefinitions "_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DLLNAME=$OUTBINNAME" - $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] + $PreprocessorDefinitions "$BASE;_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" $IgnoreStandardIncludePath $GeneratePreprocessedFile $KeepComments // Code Generation $EnableStringPooling "Yes (/GF)" - // EnableMinimalRebuild is incompatible with /MP (multi-processor builds) - // and it also makes it hard to iterate on warnings because the compiler - // detects that there is no reason to recompile when you request it. - // It should always be off? It should definitely be off for /analyze builds. - //$EnableMinimalRebuild "Yes (/Gm)" [!$ANALYZE] + $EnableMinimalRebuild $EnableC++Exceptions "No" $SmallerTypeCheck $BasicRuntimeChecks "Default" @@ -88,7 +90,6 @@ $Configuration "Debug" $BufferSecurityCheck "Yes" $EnableFunctionLevelLinking $EnableEnhancedInstructionSet - $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)" [$WIN32] $FloatingPointModel "Fast (/fp:fast)" $EnableFloatingPointExceptions @@ -127,18 +128,18 @@ $Configuration "Debug" $ShowIncludes $UndefinePreprocessorDefinitions $UndefineAllPreprocessorDefinitions - $UseFullPaths + $UseFullPaths "Yes (/FC)" $OmitDefaultLibraryNames $ErrorReporting "Prompt Immediately (/errorReport:prompt)" - // Command Line - $AdditionalOptions "$BASE /MP" + // Command Line (L4D adding /MP) + $AdditionalOptions "/MP /Zm200" } $Linker { // General - $OutputFile "$(OutDir)/$OUTBINNAME.dll" + $OutputFile "$(OutDir)/$OUTBINNAME$OUTDLLEXT" $ShowProgress "Not Set" $Version $EnableIncrementalLinking "Yes (/INCREMENTAL)" @@ -166,13 +167,12 @@ $Configuration "Debug" $ManifestFile $AdditionalManifestDependencies $AllowIsolation + //$UACExecutionLevel [$VS2010] // Debugging $GenerateDebugInfo "Yes (/DEBUG)" $GenerateProgramDatabaseFile "$(IntDir)/$(TargetName).pdb" $StripPrivateSymbols - $GenerateMapFile "No" - $MapFileName "$(IntDir)/$(TargetName).map" $MapExports $DebuggableAssembly @@ -188,6 +188,9 @@ $Configuration "Debug" $SwapRunFromNetwork $Driver + // DYNAMICBASE/ASLR in debug builds is annoying and not helpful. + $RandomizedBaseAddress "false" + // Optimization $References $EnableCOMDATFolding @@ -213,6 +216,7 @@ $Configuration "Debug" $DelayLoadedDLL $ImportLibrary $MergeSections + $TargetMachine $Profile $CLRThreadAttribute $CLRImageType @@ -226,12 +230,6 @@ $Configuration "Debug" $AdditionalOptions } - $Linker [$VS2010] - { - // SAFE_SEH should always be disabled on debug builds. - $ImageHasSafeExceptionHandlers "false" - } - $ManifestTool { // General @@ -285,7 +283,7 @@ $Configuration "Debug" $Resources { // General - $PreprocessorDefinitions "_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" + $PreprocessorDefinitions "$BASE;_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" $Culture "English (United States) (0x409)" $AdditionalIncludeDirectories $IgnoreStandardIncludePath diff --git a/sp/src/vpc_scripts/source_dll_win32_release.vpc b/sp/src/vpc_scripts/source_dll_win32_release.vpc index 997d5809..58eea752 100644 --- a/sp/src/vpc_scripts/source_dll_win32_release.vpc +++ b/sp/src/vpc_scripts/source_dll_win32_release.vpc @@ -6,18 +6,34 @@ $IgnoreRedundancyWarning "ON" -$MacroRequired "PLATSUBDIR" +// Disable frame pointer omission to allow fast stack walking, necessary for +// good ETW profiling. +$Macro NOFPO "1" + $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" $MacroRequired "OUTBINDIR" +$MacroRequired "LIBPUBLIC" +$MacroRequired "LIBCOMMON" +$MacroRequired "PLATSUBDIR" +$MacroRequired "OUTDLLEXT" +$MacroRequiredAllowEmpty "GAMENAME" +$MacroRequiredAllowEmpty "INTERMEDIATESUBDIR" +$MacroRequiredAllowEmpty "_UNITYSUBDIR" +$Macro "_SUBDIRSUFFIX" "$INTERMEDIATESUBDIR$GAMENAME$PLATSUBDIR$_UNITYSUBDIR" $Configuration "Release" { $General { // General - $OutputDirectory ".\Release$PLATSUBDIR" - $IntermediateDirectory ".\Release$PLATSUBDIR" + $OutputDirectory ".\Release$_SUBDIRSUFFIX" [!$RETAIL && !$PROFILE] + $IntermediateDirectory ".\Release$_SUBDIRSUFFIX" [!$RETAIL && !$PROFILE] + $OutputDirectory ".\Retail$_SUBDIRSUFFIX" [$RETAIL] + $IntermediateDirectory ".\Retail$_SUBDIRSUFFIX" [$RETAIL] + $OutputDirectory ".\Profile$_SUBDIRSUFFIX" [!$RETAIL && $PROFILE] + $IntermediateDirectory ".\Profile$_SUBDIRSUFFIX" [!$RETAIL && $PROFILE] + $ExtensionsToDeleteOnClean $BuildLogFile $InheritedProjectPropertySheets @@ -29,7 +45,7 @@ $Configuration "Release" $MinimizeCRTUseInATL $CharacterSet "Use Multi-Byte Character Set" $CommonLanguageRuntimeSupport - $WholeProgramOptimization + $WholeProgramOptimization "Use Link Time Code Generation" [$LTCG] } $Debugging @@ -52,7 +68,6 @@ $Configuration "Release" $DebugInformationFormat "Program Database (/Zi)" $SuppressStartupBanner $WarningLevel "Level 4 (/W4)" - $Detect64bitPortabilityIssues "Yes (/Wp64)" $TreatWarningsAsErrors $UseUNICODEResponseFiles @@ -66,10 +81,8 @@ $Configuration "Release" $WholeProgramOptimization // Preprocessor - $PreprocessorDefinitions "WIN32;_WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DLLNAME=$OUTBINNAME" - // Enable asserts in release builds if /define:releaseasserts is specified on the VPC command line. - $PreprocessorDefinitions "$BASE;RELEASEASSERTS" [$RELEASEASSERTS] - $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] + $PreprocessorDefinitions "$BASE;WIN32;_WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" + $PreprocessorDefinitions "$BASE;RELEASE_ASSERTS" [$RELEASEASSERTS] $IgnoreStandardIncludePath $GeneratePreprocessedFile $KeepComments @@ -82,11 +95,10 @@ $Configuration "Release" $BasicRuntimeChecks $RuntimeLibrary "Multi-threaded (/MT)" $StructMemberAlignment - $BufferSecurityCheck "Yes" [$STAGING_ONLY] - $BufferSecurityCheck "No" [!$STAGING_ONLY] + $BufferSecurityCheck "No" [$RETAIL] + $BufferSecurityCheck "Yes" [!$RETAIL] $EnableFunctionLevelLinking "Yes (/Gy)" $EnableEnhancedInstructionSet - $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)" [$WIN32] $FloatingPointModel "Fast (/fp:fast)" $EnableFloatingPointExceptions @@ -125,20 +137,21 @@ $Configuration "Release" $ShowIncludes $UndefinePreprocessorDefinitions $UndefineAllPreprocessorDefinitions - $UseFullPaths + $UseFullPaths "Yes (/FC)" $OmitDefaultLibraryNames $ErrorReporting "Prompt Immediately (/errorReport:prompt)" - // Command Line - $AdditionalOptions "$BASE /MP" + // Command Line (L4D adding /MP) + $AdditionalOptions "/MP /Zm200" // Enable extra debugging information. - $AdditionalOptions "$BASE /d2Zi+" + $AdditionalOptions "$BASE /d2Zi+" [$VS2010] + $AdditionalOptions "$BASE /Oy-" [$NOFPO] } $Linker { // General - $OutputFile "$(OutDir)/$OUTBINNAME.dll" + $OutputFile "$(OutDir)/$OUTBINNAME$OUTDLLEXT" $ShowProgress "Not Set" $Version $EnableIncrementalLinking "No (/INCREMENTAL:NO)" @@ -166,13 +179,12 @@ $Configuration "Release" $ManifestFile $AdditionalManifestDependencies $AllowIsolation + //$UACExecutionLevel // Debugging $GenerateDebugInfo "Yes (/DEBUG)" $GenerateProgramDatabaseFile "$(IntDir)/$(TargetName).pdb" $StripPrivateSymbols - $GenerateMapFile "No" - $MapFileName "$(IntDir)/$(TargetName).map" $MapExports $DebuggableAssembly @@ -188,9 +200,22 @@ $Configuration "Release" $SwapRunFromNetwork $Driver + // RandomizeBaseAddress (/DYNAMICBASE, /ASLR) is a hugely important security setting. + // However it can cause confusion during development and can make tracking down certain + // bugs tricky by making code/stack/heap addresses change between runs. Enable for retail, + // but disable for development builds. + $RandomizedBaseAddress "true" [$RETAIL] + $RandomizedBaseAddress "false" [!$RETAIL] + // Optimization $References "Eliminate Unreferenced Data (/OPT:REF)" - $EnableCOMDATFolding "Remove Redundant COMDATs (/OPT:ICF)" + // COMDAT folding can be very confusing when debugging and profiling because it can + // cause execution to go through nonsensical functions (that happen to be binary + // equivalent to the logical function). The performance benefit is small enough that + // it is not worth enabling in the development builds. It should be enabled on retail + // builds. + $EnableCOMDATFolding "Remove Redundant COMDATs (/OPT:ICF)" [$RETAIL] + $EnableCOMDATFolding "No (/OPT:NOICF)" [!$RETAIL] $OptimizeForWindows98 $FunctionOrder $ProfileGuidedDatabase @@ -208,12 +233,13 @@ $Configuration "Release" $NoEntryPoint $SetChecksum $BaseAddress "$LOADADDRESS_DEVELOPMENT" - $BaseAddress "$LOADADDRESS_RETAIL" [$RETAIL] + //$BaseAddress "$LOADADDRESS_RETAIL" [$RETAIL] $FixedBaseAddress $TurnOffAssemblyGeneration $DelayLoadedDLL $ImportLibrary $MergeSections + $TargetMachine $Profile $CLRThreadAttribute $CLRImageType @@ -224,7 +250,7 @@ $Configuration "Release" $CLRUnmanagedCodeCheck // Command Line - $AdditionalOptions "$BASE /DYNAMICBASE" + $AdditionalOptions } $ManifestTool @@ -280,7 +306,7 @@ $Configuration "Release" $Resources { // General - $PreprocessorDefinitions "NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" + $PreprocessorDefinitions "$BASE;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" $Culture "English (United States) (0x409)" $AdditionalIncludeDirectories $IgnoreStandardIncludePath @@ -320,4 +346,4 @@ $Configuration "Release" $Outputs $AdditionalDependencies } -} \ No newline at end of file +} diff --git a/sp/src/vpc_scripts/source_exe_base.vpc b/sp/src/vpc_scripts/source_exe_base.vpc index 7fc9096d..24b94cb2 100644 --- a/sp/src/vpc_scripts/source_exe_base.vpc +++ b/sp/src/vpc_scripts/source_exe_base.vpc @@ -1,13 +1,20 @@ -//----------------------------------------------------------------------------- -// source_exe_base.VPC -// -// Project Script -//----------------------------------------------------------------------------- - +$Include "$SRCDIR\vpc_scripts\platform_dirs.vpc" $include "$SRCDIR\vpc_scripts\source_base.vpc" -$include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc" [$WINDOWS] -$Include "$SRCDIR\vpc_scripts\source_exe_linux_base.vpc" [$LINUX] -$include "$SRCDIR\vpc_scripts\source_exe_posix_base.vpc" [$POSIX && !$LINUX] -$include "$SRCDIR\vpc_scripts\source_xex_x360_base.vpc" [$X360] +$Include "$SRCDIR\vpc_scripts\source_exe_posix_base.vpc" [$POSIX] +$Include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc" [$WIN32 || $WIN64] +$Include "$SRCDIR\vpc_scripts\source_xex_x360_base.vpc" [$X360] +$Include "$SRCDIR\vpc_scripts\source_ppu_elf_ps3_base.vpc" [$PS3] + $Include "$SRCDIR\vpc_scripts\source_video_base.vpc" + +$Configuration +{ + $Compiler + { + $PreprocessorDefinitions "$BASE;DEV_BUILD" [!$PUBLISH] + $PreprocessorDefinitions "$BASE;_PROFILE" [$PROFILE && !$RETAIL] + $PreprocessorDefinitions "$BASE;RETAIL_ASSERTS" [$RETAIL && $RETAILASSERTS] + $PreprocessorDefinitions "$BASE;FRAME_POINTER_OMISSION_DISABLED" [$NOFPO || $VS2010] + } +} \ No newline at end of file diff --git a/sp/src/vpc_scripts/source_exe_con_base.vpc b/sp/src/vpc_scripts/source_exe_con_base.vpc new file mode 100644 index 00000000..8edc0449 --- /dev/null +++ b/sp/src/vpc_scripts/source_exe_con_base.vpc @@ -0,0 +1,18 @@ +$Include "$SRCDIR\vpc_scripts\platform_dirs.vpc" +$include "$SRCDIR\vpc_scripts\source_base.vpc" + + +$Include "$SRCDIR\vpc_scripts\source_exe_con_win32_base.vpc" [$WINDOWS] +$Include "$SRCDIR\vpc_scripts\source_exe_posix_base.vpc" [$POSIX] +$Include "$SRCDIR\vpc_scripts\source_xex_x360_base.vpc" [$X360] + +$Configuration +{ + $Compiler + { + $PreprocessorDefinitions "$BASE;DEV_BUILD" [!$PUBLISH] + $PreprocessorDefinitions "$BASE;_PROFILE" [$PROFILE && !$RETAIL] + $PreprocessorDefinitions "$BASE;RETAIL_ASSERTS" [$RETAIL && $RETAILASSERTS] + $PreprocessorDefinitions "$BASE;FRAME_POINTER_OMISSION_DISABLED" [$NOFPO || $VS2010] + } +} diff --git a/sp/src/vpc_scripts/source_exe_con_win32_base.vpc b/sp/src/vpc_scripts/source_exe_con_win32_base.vpc index 0b83dfa9..e410cdf0 100644 --- a/sp/src/vpc_scripts/source_exe_con_win32_base.vpc +++ b/sp/src/vpc_scripts/source_exe_con_win32_base.vpc @@ -7,6 +7,8 @@ $IgnoreRedundancyWarning "ON" $MacroRequired "SRCDIR" $MacroRequired "OUTBINDIR" +$MacroRequired "PLATSUBDIR" + $Include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc" diff --git a/sp/src/vpc_scripts/source_exe_posix_base.vpc b/sp/src/vpc_scripts/source_exe_posix_base.vpc index d864cc0e..33e7b2a6 100644 --- a/sp/src/vpc_scripts/source_exe_posix_base.vpc +++ b/sp/src/vpc_scripts/source_exe_posix_base.vpc @@ -5,10 +5,11 @@ //----------------------------------------------------------------------------- $Include "$SRCDIR\vpc_scripts\version.vpc" -$Include "$SRCDIR\vpc_scripts\source_posix_base.vpc" $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" "$PROJECTNAME" +$Macro IS_LIB_PROJECT "1" +$Include "$SRCDIR\vpc_scripts\source_posix_base.vpc" $Include "$SRCDIR\vpc_scripts\loadaddress.vpc" @@ -22,9 +23,21 @@ $Configuration $ConfigurationType "Application (.exe)" } + $Compiler + { + $PreprocessorDefinitions "$BASE;EXENAME=$OUTBINNAME" + } + $Linker { - $OutputFile "$SRCDIR/../game/$OUTBINNAME" + $OutputFile "$SRCDIR/../game/$OUTBINNAME" + + // In order to get the Valve standard allocator memory alignment (16-byte + // alignment for objects that are a multiple of 16 bytes) we use tcmalloc. + // Using -l will ask the linker to use it, but if there are no references + // to malloc/free then it may not actually use it. Wrapping the flag in the + // as-needed controls forces it to be pulled in (from libtcmalloc_minimal.so). + $GCC_ExtraLinkerFlags "-Wl,--no-as-needed -ltcmalloc_minimal -Wl,--as-needed" [$LINUXALL&&!$DEDICATED] } } @@ -49,16 +62,10 @@ $Project { $File "$ROOTSCRIPT" } - - - $Folder "Link Libraries" + + $Folder "Link Libraries" [$LINUXALL&&!$DEDICATED] { - $ImpLib tier0 [$LINUXALL] - $Lib tier1 [$LINUXALL] - $ImpLib vstdlib [$LINUXALL] - $DynamicFile "$SRCDIR\lib\$PLATFORM\$_IMPLIB_PREFIXtier0$_IMPLIB_EXT" [!$LINUXALL] - $DynamicFile "$SRCDIR\lib\$PLATFORM\tier1$_STATICLIB_EXT" [!$LINUXALL] - $DynamicFile "$SRCDIR\lib\$PLATFORM\$_IMPLIB_PREFIXvstdlib$_IMPLIB_EXT" [!$LINUXALL] + $File "$SRCDIR/thirdparty/gperftools-2.0/.libs/libtcmalloc_minimal.so" } } diff --git a/sp/src/vpc_scripts/source_exe_qt_base.vpc b/sp/src/vpc_scripts/source_exe_qt_base.vpc new file mode 100644 index 00000000..c327c7b4 --- /dev/null +++ b/sp/src/vpc_scripts/source_exe_qt_base.vpc @@ -0,0 +1,5 @@ +// call up either the posix or win32 vpc file based upon target platform + +//$Include "$SRCDIR\vpc_scripts\source_exe_qt_linux_base.vpc" [$POSIX] +$Include "$SRCDIR\vpc_scripts\source_exe_qt_win32_base.vpc" [$WIN32 || $WIN64] + \ No newline at end of file diff --git a/sp/src/vpc_scripts/source_exe_qt_con_base.vpc b/sp/src/vpc_scripts/source_exe_qt_con_base.vpc new file mode 100644 index 00000000..4620e908 --- /dev/null +++ b/sp/src/vpc_scripts/source_exe_qt_con_base.vpc @@ -0,0 +1,16 @@ +// base file for a console app with qt. win32 only for now. CG: I'm not 100% sure this is the right definition, +// but I'm moving the logic here so it doesn't end up pasted into every such app. + +$Include "$SRCDIR\vpc_scripts\source_exe_qt_win32_base.vpc" + +$Configuration +{ + $Linker + { + $SubSystem "Console (/SUBSYSTEM:CONSOLE)" + } + $Compiler + { + $AdditionalIncludeDirectories "$BASE,..\common" + } +} diff --git a/sp/src/vpc_scripts/source_exe_qt_win32_base.vpc b/sp/src/vpc_scripts/source_exe_qt_win32_base.vpc new file mode 100644 index 00000000..bb186df3 --- /dev/null +++ b/sp/src/vpc_scripts/source_exe_qt_win32_base.vpc @@ -0,0 +1,48 @@ +//===================== Copyright (c) Valve Corporation. All Rights Reserved. ====================== +// +//================================================================================================== + +$Macro QT_ROOT "$SRCDIR\thirdparty\lgpl\qt" + +$Include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc" +$Include "$SRCDIR\vpc_scripts\qt_base.vpc" + +$Configuration +{ + $Compiler + { + $AdditionalIncludeDirectories "$BASE;.\;$SRCDIR\game\shared;$QT_ROOT\include;.\$QT_TARGET_SUBDIR" + $PreprocessorDefinitions "$BASE;UNICODE;QT_LARGEFILE_SUPPORT;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT" + $PreprocessorDefinitions "$BASE;QT_NO_DEBUG" [!$QTDEBUG] + $DisableSpecificWarnings "4127;4512;$BASE" + } +} + +$Configuration +{ + $Linker + { + // Link tier0 first because Qt needs our allocators during static object initization! + $AdditionalDependencies "$BASE $LIBPUBLIC\tier0.lib" + $GenerateManifest "Yes" + $AdditionalOptions "$BASE $QUOTE/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'$QUOTE" + } +} + +$Project +{ + $Folder "Link Libraries" [$QTDEBUG] + { + $Lib "$QT_ROOT\lib\qtmaind" + $Lib "$QT_ROOT\lib\qtcored4" + $Lib "$QT_ROOT\lib\qtguid4" + } + + $Folder "Link Libraries" [!$QTDEBUG] + { + $Lib "$QT_ROOT\lib\qtmain" + $Lib "$QT_ROOT\lib\qtcore4" + $Lib "$QT_ROOT\lib\qtgui4" + } +} + diff --git a/sp/src/vpc_scripts/source_exe_win_win32_base.vpc b/sp/src/vpc_scripts/source_exe_win_win32_base.vpc index ff784642..bda4bc3c 100644 --- a/sp/src/vpc_scripts/source_exe_win_win32_base.vpc +++ b/sp/src/vpc_scripts/source_exe_win_win32_base.vpc @@ -6,59 +6,71 @@ $Include "$SRCDIR\vpc_scripts\version.vpc" -$Macro NOAPPENDPLATSUBDIR "1" [!$WIN64] - -$MacroRequired "PLATSUBDIR" $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" "$PROJECTNAME" $MacroRequired "OUTBINDIR" -// These are convenient for adjusting directory paths based on platform -// but they must be used without absolute consistency to avoid dependency -// problems. It appears that if VPC compares $LIBPUBLIC to $SRCDIR\lib\public -// it will decide that they are not equal, even if the *value* of $LIBPUBLIC -// is $SRCDIR\lib\public. These macros can safely be used in copy commands -// and other areas that VPC doesn't use for dependency tracking. -$Macro LIBPUBLIC "$SRCDIR\lib\public" -$Macro LIBCOMMON "$SRCDIR\lib\common" +$Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR" +$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" $Include "$SRCDIR\vpc_scripts\loadaddress.vpc" $Include "$SRCDIR\vpc_scripts\source_exe_win_win32_debug.vpc" $Include "$SRCDIR\vpc_scripts\source_exe_win_win32_release.vpc" $Include "$SRCDIR\vpc_scripts\source_win32_base.vpc" -// Fix up directories for targets like win64 -$Macro OUTBINDIR "$OUTBINDIR$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR] -$Macro LIBPUBLIC "$LIBPUBLIC$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR] -$Macro LIBCOMMON "$LIBCOMMON$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR] - $IgnoreRedundancyWarning "ON" // Common Configuration $Configuration { - $General [$VS2010] + $General [$VS2010] + { + $TargetName "$OUTBINNAME" + } + + + $Compiler { - $TargetName "$OUTBINNAME" + $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64] + $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32] + $PreprocessorDefinitions "$BASE;COMPILER_MSVC;EXENAME=$OUTBINNAME;_DLL_EXT=$_DLL_EXT" } + $Compiler [$WIN32] + { + $EnableEnhancedInstructionSet "Streaming SIMD Extensions 2 (/arch:SSE2)" + } + + $Linker + { + $AdditionalDependencies "$BASE shell32.lib user32.lib advapi32.lib gdi32.lib comdlg32.lib ole32.lib" [$WIN32] + $TargetMachine "MachineX86 (/MACHINE:X86)" [$WIN32] + $TargetMachine "MachineX64 (/MACHINE:X64)" [$WIN64] + // NXCOMPAT (also known as DEP or Data Access Protection) should be enabled for all + // executables for security and debugging reasons. + $AdditionalOptions "/NXCOMPAT" + // Suppress this pointless warning using the undocumented /ignore linker switch + // schemalib.lib(schemaclassinfo.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library + $AdditionalOptions "$BASE /ignore:4221" + } + $PreBuildEvent { $CommandLine "if EXIST $OUTBINDIR\$(TargetFileName) for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTBINDIR\$(TargetFileName)$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \ "set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \ "if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \ - "$CRCCHECK" + "$CRCCHECK" "\n" } $PostBuildEvent [!$ANALYZE] { - $CommandLine "if not exist $QUOTE$OUTBINDIR$QUOTE mkdir $QUOTE$OUTBINDIR$QUOTE" "\n" - $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetFileName) $SRCDIR" "\n" [! $SOURCESDK ] - $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetFileName) $OUTBINDIR\$(TargetFileName)" "\n" \ + $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetFileName) $SRCDIR" "\n" [!$SOURCESDK] + $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetFileName) $OUTBINDIR\$(TargetFileName) >nul" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ - "if exist $QUOTE$(TargetDir)$QUOTE$(TargetName).map copy $QUOTE$(TargetDir)$QUOTE$(TargetName).map $OUTBINDIR\$(TargetName).map" "\n" - $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" [ !$SOURCESDK ] - $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetName).pdb $OUTBINDIR\$(TargetName).pdb" "\n" \ + "if exist $QUOTE$(TargetDir)$QUOTE$(TargetName).map copy $QUOTE$(TargetDir)$QUOTE$(TargetName).map $OUTBINDIR\$(TargetName).map >nul" "\n" + $CommandLine "$BASE" "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTBINDIR\$(TargetName).pdb $SRCDIR" "\n" [!$SOURCESDK] + $CommandLine "$BASE" "copy $QUOTE$(TargetDir)$QUOTE$(TargetName).pdb $OUTBINDIR\$(TargetName).pdb >nul" "\n" \ "if ERRORLEVEL 1 goto BuildEventFailed" "\n" \ "goto BuildEventOK" "\n" \ ":BuildEventFailed" "\n" \ @@ -66,29 +78,9 @@ $Configuration "del /q $QUOTE$(TargetDir)$QUOTE$(TargetFileName)" "\n" \ "exit 1" "\n" \ ":BuildEventOK" "\n" - - $CommandLine "$BASE" "\n" \ - "call $SRCDIR\devtools\bin\vsign.bat -sign $OUTBINDIR\$(TargetFileName)" "\n" [$RETAIL && !$SOURCESDK ] - - $CommandLine "$BASE" "\n" \ - "call $SRCDIR\devtools\bin\vsign.bat -signvalve $OUTBINDIR\$(TargetFileName)" "\n" [!$RETAIL && !$SOURCESDK ] - $Description "Publishing to $OUTBINDIR" $ExcludedFromBuild "No" } - - $Linker - { - // NXCOMPAT (also known as DEP or Data Access Protection) should be enabled for all - // executables for security and debugging reasons. - $AdditionalOptions "$BASE /NXCOMPAT" - // Suppress this warning using the undocumented /ignore linker switch - // schemalib.lib(schemaclassinfo.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library - $AdditionalOptions "$BASE /ignore:4221" - $AdditionalDependencies "%(AdditionalDependencies)" [$VS2010] - $TargetMachine "MachineX86 (/MACHINE:X86)" [$WIN32] - $TargetMachine "MachineX64 (/MACHINE:X64)" [$WIN64] - } } // Skeleton Project - All derived projects get this as a starting base @@ -106,33 +98,13 @@ $Project } } } - - // Implement __imp__EncodePointer and __imp__DecodePointer so that we can run on XP SP1 - // when building with VS 2010. - $File "$SRCDIR\public\tier0\pointeroverride.asm" [$WIN32 && $VS2010] - { - $Configuration - { - $CustomBuildStep - { - // General - $CommandLine "$QUOTE$(VCInstallDir)bin\ml.exe$QUOTE /c /Cp /Zi /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE" - $Description "Compiling pointeroverride.asm" - $Outputs "$(IntDir)\$(InputName).obj" - } - } - } } $Folder "Link Libraries" { - $DynamicFile "$SRCDIR\lib\public\tier0.lib" [$NOAPPENDPLATSUBDIR] - $DynamicFile "$SRCDIR\lib\public\tier1.lib" [$NOAPPENDPLATSUBDIR] - $DynamicFile "$SRCDIR\lib\public\vstdlib.lib" [$NOAPPENDPLATSUBDIR] - - $DynamicFile "$SRCDIR\lib\public$PLATSUBDIR\tier0.lib" [!$NOAPPENDPLATSUBDIR] - $DynamicFile "$SRCDIR\lib\public$PLATSUBDIR\tier1.lib" [!$NOAPPENDPLATSUBDIR] - $DynamicFile "$SRCDIR\lib\public$PLATSUBDIR\vstdlib.lib" [!$NOAPPENDPLATSUBDIR] + $Implib "$LIBPUBLIC\tier0" + $Lib "$LIBPUBLIC\tier1" + $Implib "$LIBPUBLIC\vstdlib" } } diff --git a/sp/src/vpc_scripts/source_exe_win_win32_debug.vpc b/sp/src/vpc_scripts/source_exe_win_win32_debug.vpc index 06d2401b..e3728d6e 100644 --- a/sp/src/vpc_scripts/source_exe_win_win32_debug.vpc +++ b/sp/src/vpc_scripts/source_exe_win_win32_debug.vpc @@ -6,18 +6,25 @@ $IgnoreRedundancyWarning "ON" -$MacroRequired "PLATSUBDIR" $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" $MacroRequired "OUTBINDIR" +$MacroRequired "LIBPUBLIC" +$MacroRequired "LIBCOMMON" +$MacroRequired "PLATSUBDIR" +$MacroRequiredAllowEmpty "GAMENAME" +$MacroRequiredAllowEmpty "INTERMEDIATESUBDIR" +$MacroRequiredAllowEmpty "_UNITYSUBDIR" +$MacroRequiredAllowEmpty "_STATICSUBDIR" +$Macro "_SUBDIRSUFFIX" "$INTERMEDIATESUBDIR$_STATICSUBDIR$GAMENAME$PLATSUBDIR$_UNITYSUBDIR" $Configuration "Debug" { $General { // General - $OutputDirectory ".\Debug$PLATSUBDIR" - $IntermediateDirectory ".\Debug$PLATSUBDIR" + $OutputDirectory ".\Debug$_SUBDIRSUFFIX" + $IntermediateDirectory ".\Debug$_SUBDIRSUFFIX" $ExtensionsToDeleteOnClean $BuildLogFile $InheritedProjectPropertySheets @@ -50,11 +57,10 @@ $Configuration "Debug" // General $AdditionalIncludeDirectories "$SRCDIR\common;$SRCDIR\public;$SRCDIR\public\tier0;$SRCDIR\public\tier1" $Resolve#UsingReferences - $DebugInformationFormat "Program Database for Edit & Continue (/ZI)" [!$EANDCDISABLED && !$WIN64] - $DebugInformationFormat "Program Database (/Zi)" [$EANDCDISABLED || $WIN64] + $DebugInformationFormat "Program Database for Edit & Continue (/ZI)" [$WIN32] + $DebugInformationFormat "Program Database (/Zi)" [$WIN64] $SuppressStartupBanner $WarningLevel "Level 4 (/W4)" - $Detect64bitPortabilityIssues "Yes (/Wp64)" $TreatWarningsAsErrors "No" $UseUNICODEResponseFiles "No" @@ -68,8 +74,7 @@ $Configuration "Debug" $WholeProgramOptimization // Preprocessor - $PreprocessorDefinitions "_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" - $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] + $PreprocessorDefinitions "$BASE;_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" $IgnoreStandardIncludePath $GeneratePreprocessedFile $KeepComments @@ -89,7 +94,6 @@ $Configuration "Debug" $BufferSecurityCheck "Yes" $EnableFunctionLevelLinking $EnableEnhancedInstructionSet - $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)" [$WIN32] $FloatingPointModel "Fast (/fp:fast)" $EnableFloatingPointExceptions @@ -128,12 +132,12 @@ $Configuration "Debug" $ShowIncludes $UndefinePreprocessorDefinitions $UndefineAllPreprocessorDefinitions - $UseFullPaths + $UseFullPaths "Yes (/FC)" $OmitDefaultLibraryNames $ErrorReporting "Prompt Immediately (/errorReport:prompt)" // Command Line - $AdditionalOptions "$BASE /MP" + $AdditionalOptions } $Linker @@ -163,18 +167,16 @@ $Configuration "Debug" $AssemblyLinkResource // Manifest File - $GenerateManifest "No" [!$VS2010] - $GenerateManifest "Yes" [$VS2010] + $GenerateManifest "Yes" $ManifestFile $AdditionalManifestDependencies $AllowIsolation + $UACExecutionLevel // Debugging $GenerateDebugInfo "Yes (/DEBUG)" $GenerateProgramDatabaseFile "$(IntDir)/$(TargetName).pdb" $StripPrivateSymbols - $GenerateMapFile "No" - $MapFileName "$(IntDir)/$(TargetName).map" $MapExports $DebuggableAssembly @@ -190,6 +192,9 @@ $Configuration "Debug" $SwapRunFromNetwork $Driver + // DYNAMICBASE/ASLR in debug builds is annoying and not helpful. + $RandomizedBaseAddress "false" + // Optimization $References $EnableCOMDATFolding @@ -215,6 +220,7 @@ $Configuration "Debug" $DelayLoadedDLL $ImportLibrary $MergeSections + $TargetMachine $Profile $CLRThreadAttribute $CLRImageType @@ -223,12 +229,9 @@ $Configuration "Debug" $DelaySign $ErrorReporting "Prompt Immediately (/ERRORREPORT:PROMPT)" $CLRUnmanagedCodeCheck - } - $Linker [$VS2010] - { - // SAFE_SEH should always be disabled on debug builds. - $ImageHasSafeExceptionHandlers "false" + // Command Line + $AdditionalOptions } $ManifestTool diff --git a/sp/src/vpc_scripts/source_exe_win_win32_release.vpc b/sp/src/vpc_scripts/source_exe_win_win32_release.vpc index 9948bf15..eed85c40 100644 --- a/sp/src/vpc_scripts/source_exe_win_win32_release.vpc +++ b/sp/src/vpc_scripts/source_exe_win_win32_release.vpc @@ -6,18 +6,33 @@ $IgnoreRedundancyWarning "ON" -$MacroRequired "PLATSUBDIR" +// Disable frame pointer omission to allow fast stack walking, necessary for +// good ETW profiling. +$Macro NOFPO "1" + $MacroRequired "SRCDIR" $MacroRequired "OUTBINNAME" $MacroRequired "OUTBINDIR" +$MacroRequired "LIBPUBLIC" +$MacroRequired "LIBCOMMON" +$MacroRequired "PLATSUBDIR" +$MacroRequiredAllowEmpty "GAMENAME" +$MacroRequiredAllowEmpty "INTERMEDIATESUBDIR" +$MacroRequiredAllowEmpty "_UNITYSUBDIR" +$MacroRequiredAllowEmpty "_STATICSUBDIR" +$Macro "_SUBDIRSUFFIX" "$INTERMEDIATESUBDIR$_STATICSUBDIR$GAMENAME$PLATSUBDIR$_UNITYSUBDIR" $Configuration "Release" { $General { // General - $OutputDirectory ".\Release$PLATSUBDIR" - $IntermediateDirectory ".\Release$PLATSUBDIR" + $OutputDirectory ".\Release$_SUBDIRSUFFIX" [!$RETAIL && !$PROFILE] + $IntermediateDirectory ".\Release$_SUBDIRSUFFIX" [!$RETAIL && !$PROFILE] + $OutputDirectory ".\Retail$_SUBDIRSUFFIX" [$RETAIL] + $IntermediateDirectory ".\Retail$_SUBDIRSUFFIX" [$RETAIL] + $OutputDirectory ".\Profile$_SUBDIRSUFFIX" [!$RETAIL && $PROFILE] + $IntermediateDirectory ".\Profile$_SUBDIRSUFFIX" [!$RETAIL && $PROFILE] $ExtensionsToDeleteOnClean $BuildLogFile $InheritedProjectPropertySheets @@ -29,7 +44,7 @@ $Configuration "Release" $MinimizeCRTUseInATL $CharacterSet "Use Multi-Byte Character Set" $CommonLanguageRuntimeSupport - $WholeProgramOptimization + $WholeProgramOptimization "Use Link Time Code Generation" [$LTCG] } $Debugging @@ -53,7 +68,6 @@ $Configuration "Release" $DebugInformationFormat "Program Database (/Zi)" $SuppressStartupBanner $WarningLevel "Level 4 (/W4)" - $Detect64bitPortabilityIssues "Yes (/Wp64)" $TreatWarningsAsErrors $UseUnicodeResponseFiles @@ -67,10 +81,8 @@ $Configuration "Release" $WholeProgramOptimization // Preprocessor - $PreprocessorDefinitions "WIN32;_WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" - // Enable asserts in release builds if /define:releaseasserts is specified on the VPC command line. - $PreprocessorDefinitions "$BASE;RELEASEASSERTS" [$RELEASEASSERTS] - $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] + $PreprocessorDefinitions "$BASE;WIN32;_WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" + $PreprocessorDefinitions "$BASE;RELEASE_ASSERTS" [$RELEASEASSERTS] $IgnoreStandardIncludePath $GeneratePreprocessedFile $KeepComments @@ -83,11 +95,10 @@ $Configuration "Release" $BasicRuntimeChecks $RuntimeLibrary "Multi-threaded (/MT)" $StructMemberAlignment - $BufferSecurityCheck "Yes" [$STAGING_ONLY] - $BufferSecurityCheck "No" [!$STAGING_ONLY] + $BufferSecurityCheck "No" [$RETAIL] + $BufferSecurityCheck "Yes" [!$RETAIL] $EnableFunctionLevelLinking "Yes (/Gy)" $EnableEnhancedInstructionSet - $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)" [$WIN32] $FloatingPointModel "Fast (/fp:fast)" $EnableFloatingPointExceptions @@ -126,14 +137,14 @@ $Configuration "Release" $ShowIncludes $UndefinePreprocessorDefinitions $UndefineAllPreprocessorDefinitions - $UseFullPaths + $UseFullPaths "Yes (/FC)" $OmitDefaultLibraryNames $ErrorReporting "Prompt Immediately (/errorReport:prompt)" - // Command Line - $AdditionalOptions "$BASE /MP" // Enable extra debugging information. - $AdditionalOptions "$BASE /d2Zi+" + $AdditionalOptions "$BASE /d2Zi+" [$VS2010] + // Command Line + $AdditionalOptions "$BASE /Oy-" [$NOFPO] } $Linker @@ -163,18 +174,16 @@ $Configuration "Release" $AssemblyLinkResource // Manifest File - $GenerateManifest "No" [!$VS2010] - $GenerateManifest "Yes" [$VS2010] + $GenerateManifest "Yes" $ManifestFile $AdditionalManifestDependencies $AllowIsolation + $UACExecutionLevel // Debugging $GenerateDebugInfo "Yes (/DEBUG)" $GenerateProgramDatabaseFile "$(IntDir)/$(TargetName).pdb" $StripPrivateSymbols - $GenerateMapFile "No" - $MapFileName "$(IntDir)/$(TargetName).map" $MapExports $DebuggableAssembly @@ -190,9 +199,22 @@ $Configuration "Release" $SwapRunFromNetwork $Driver + // RandomizeBaseAddress (/DYNAMICBASE, /ASLR) is a hugely important security setting. + // However it can cause confusion during development and can make tracking down certain + // bugs tricky by making code/stack/heap addresses change between runs. Enable for retail, + // but disable for development builds. + $RandomizedBaseAddress "true" [$RETAIL] + $RandomizedBaseAddress "false" [!$RETAIL] + // Optimization $References "Eliminate Unreferenced Data (/OPT:REF)" - $EnableCOMDATFolding "Remove Redundant COMDATs (/OPT:ICF)" + // COMDAT folding can be very confusing when debugging and profiling because it can + // cause execution to go through nonsensical functions (that happen to be binary + // equivalent to the logical function). The performance benefit is small enough that + // it is not worth enabling in the development builds. It should be enabled on retail + // builds. + $EnableCOMDATFolding "Remove Redundant COMDATs (/OPT:ICF)" [$RETAIL] + $EnableCOMDATFolding "No (/OPT:NOICF)" [!$RETAIL] $OptimizeForWindows98 $FunctionOrder $ProfileGuidedDatabase @@ -210,12 +232,13 @@ $Configuration "Release" $NoEntryPoint $SetChecksum $BaseAddress "$LOADADDRESS_DEVELOPMENT" - $BaseAddress "$LOADADDRESS_RETAIL" [$RETAIL] + //$BaseAddress "$LOADADDRESS_RETAIL" [$RETAIL] $FixedBaseAddress $TurnOffAssemblyGeneration $DelayLoadedDLL $ImportLibrary $MergeSections + $TargetMachine $Profile $CLRThreadAttribute $CLRImageType @@ -226,7 +249,7 @@ $Configuration "Release" $CLRUnmanagedCodeCheck // Command Line - $AdditionalOptions "$BASE /DYNAMICBASE" + $AdditionalOptions } $ManifestTool diff --git a/sp/src/vpc_scripts/source_lib_base.vpc b/sp/src/vpc_scripts/source_lib_base.vpc index eeeb2ba1..9a07dbe7 100644 --- a/sp/src/vpc_scripts/source_lib_base.vpc +++ b/sp/src/vpc_scripts/source_lib_base.vpc @@ -1,20 +1,22 @@ -//----------------------------------------------------------------------------- -// source_lib_base.VPC -// -// Project Script -//----------------------------------------------------------------------------- - +$Include "$SRCDIR\vpc_scripts\platform_dirs.vpc" $include "$SRCDIR\vpc_scripts\source_base.vpc" -$Macro PLATSUBDIR "\linux32" [$LINUX32] -$Macro OUTBINDIR "$OUTBINDIR" [$LINUX32] -$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" [$LINUX32] -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [$LINUX32] +$MacroRequired OUTLIBDIR "$SRCDIR\lib\public$PLATSUBDIR" -$MacroRequired "OUTLIBDIR" "$SRCDIR\lib\public\$PLATFORM" [$LINUX] -$MacroRequired "OUTLIBCOMMONDIR" "$SRCDIR\lib\common\$PLATFORM" [$LINUX] -$include "$SRCDIR\vpc_scripts\source_lib_linux_base.vpc" [$LINUX] -$include "$SRCDIR\vpc_scripts\source_lib_win32_base.vpc" [$WINDOWS] -$include "$SRCDIR\vpc_scripts\source_lib_posix_base.vpc" [$POSIX && !$LINUX] +$include "$SRCDIR\vpc_scripts\source_lib_posix_base.vpc" [$POSIX] +$include "$SRCDIR\vpc_scripts\source_lib_win32_base.vpc" [$WIN32 || $WIN64] $include "$SRCDIR\vpc_scripts\source_lib_x360_base.vpc" [$X360] -$Include "$SRCDIR\vpc_scripts\source_video_base.vpc" +$include "$SRCDIR\vpc_scripts\source_ppu_lib_ps3_base.vpc" [$PS3] + +$include "$SRCDIR\vpc_scripts\source_video_base.vpc" + +$Configuration +{ + $Compiler + { + $PreprocessorDefinitions "$BASE;DEV_BUILD" [!$PUBLISH] + $PreprocessorDefinitions "$BASE;_PROFILE" [$PROFILE && !$RETAIL] + $PreprocessorDefinitions "$BASE;RETAIL_ASSERTS" [$RETAIL && $RETAILASSERTS] + $PreprocessorDefinitions "$BASE;FRAME_POINTER_OMISSION_DISABLED" [$NOFPO || $VS2010] + } +} diff --git a/sp/src/vpc_scripts/source_lib_posix_base.vpc b/sp/src/vpc_scripts/source_lib_posix_base.vpc index 5a5e4747..4b163986 100644 --- a/sp/src/vpc_scripts/source_lib_posix_base.vpc +++ b/sp/src/vpc_scripts/source_lib_posix_base.vpc @@ -1,18 +1,19 @@ -$Include "$SRCDIR\vpc_scripts\source_posix_base.vpc" -$include "$SRCDIR\tier0\tier0_exclude.vpc" [$POSIX] $MacroRequired "OUTLIBNAME" "$PROJECTNAME" +$Macro IS_LIB_PROJECT "1" + +$Include "$SRCDIR\vpc_scripts\source_posix_base.vpc" $Configuration { - $General - { - $ConfigurationType "Static Library (.lib)" - $GameOutputFile "$SRCDIR/lib/$PLATFORM/$OUTLIBNAME$_STATICLIB_EXT" + $General + { + $ConfigurationType "Static Library (.lib)" + $GameOutputFile "$OUTLIBDIR/$OUTLIBNAME$_STATICLIB_EXT" } $Linker { - $OutputFile "$SRCDIR/lib/$PLATFORM/$OUTLIBNAME$_STATICLIB_EXT" - } + $OutputFile "$OUTLIBDIR/$OUTLIBNAME$_STATICLIB_EXT" + } } diff --git a/sp/src/vpc_scripts/source_lib_qt_base.vpc b/sp/src/vpc_scripts/source_lib_qt_base.vpc new file mode 100644 index 00000000..68894746 --- /dev/null +++ b/sp/src/vpc_scripts/source_lib_qt_base.vpc @@ -0,0 +1,2 @@ +// include either the windows base or the currently non-existing ones for other platforms +$include "$SRCDIR\vpc_scripts\source_lib_qt_win32_base.vpc" diff --git a/sp/src/vpc_scripts/source_lib_qt_win32_base.vpc b/sp/src/vpc_scripts/source_lib_qt_win32_base.vpc new file mode 100644 index 00000000..d386ac86 --- /dev/null +++ b/sp/src/vpc_scripts/source_lib_qt_win32_base.vpc @@ -0,0 +1,22 @@ +//===================== Copyright (c) Valve Corporation. All Rights Reserved. ====================== +// +//================================================================================================== + +$Macro QT_ROOT "$SRCDIR\thirdparty\lgpl\qt" + +$Include "$SRCDIR\vpc_scripts\source_lib_base.vpc" +$Include "$SRCDIR\vpc_scripts\qt_base.vpc" + +$Configuration +{ + $Compiler + { + $AdditionalIncludeDirectories "$BASE;.\;$SRCDIR\game\shared;$QT_ROOT\include;.\$QT_TARGET_SUBDIR" + $PreprocessorDefinitions "$BASE;QT_LARGEFILE_SUPPORT;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT" + $PreprocessorDefinitions "$BASE;QT_NO_DEBUG" [!$QTDEBUG] + $DisableSpecificWarnings "4127;4512;$BASE" + + // Causes a bunch of bogus compiler warnings for now; let's disable it + $Detect64bitPortabilityIssues "No" + } +} diff --git a/sp/src/vpc_scripts/source_lib_win32_base.vpc b/sp/src/vpc_scripts/source_lib_win32_base.vpc index e2f6766e..b775614c 100644 --- a/sp/src/vpc_scripts/source_lib_win32_base.vpc +++ b/sp/src/vpc_scripts/source_lib_win32_base.vpc @@ -6,15 +6,12 @@ $Include "$SRCDIR\vpc_scripts\version.vpc" -$Macro NOAPPENDPLATSUBDIR "1" [!$WIN64] - -$MacroRequired "PLATSUBDIR" $MacroRequired "SRCDIR" $MacroRequired "OUTLIBNAME" "$PROJECTNAME" $MacroRequired "OUTLIBDIR" -// Fix up directories for targets like win64 -$Macro OUTLIBDIR "$OUTLIBDIR$PLATSUBDIR" [!$NOAPPENDPLATSUBDIR] +$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" $Include "$SRCDIR\vpc_scripts\source_lib_win32_debug.vpc" $Include "$SRCDIR\vpc_scripts\source_lib_win32_release.vpc" @@ -25,38 +22,41 @@ $IgnoreRedundancyWarning "ON" // Common Configuration $Configuration { - $General [$VS2010] + $General [$VS2010] { - $TargetName "$OUTLIBNAME" + $TargetName "$OUTLIBNAME" } - $General - { - $OutputDirectory "$OUTLIBDIR" - } $Compiler { + $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64] + $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32] + $PreprocessorDefinitions "$BASE;COMPILER_MSVC;_DLL_EXT=$_DLL_EXT" $PreprocessorDefinitions "$BASE;LIBNAME=$OUTLIBNAME" - $PreprocessorDefinitions "$BASE;RAD_TELEMETRY_DISABLED" [$SOURCESDK] + } + + $Compiler [$WIN32] + { + $EnableEnhancedInstructionSet "Streaming SIMD Extensions 2 (/arch:SSE2)" } $PreBuildEvent { $CommandLine "if EXIST $OUTLIBDIR\$(TargetName).lib ( for /f $QUOTEdelims=$QUOTE %%A in ('attrib $QUOTE$OUTLIBDIR\$(TargetName).lib$QUOTE') do set valveTmpIsReadOnly=$QUOTE%%A$QUOTE" "\n" \ - ") else ( mkdir $OUTLIBDIR )" "\n" \ + ") else ( if not EXIST $OUTLIBDIR mkdir $OUTLIBDIR )" "\n" \ "set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%" "\n" \ "if $QUOTE%valveTmpIsReadOnlyLetter%$QUOTE==$QUOTER$QUOTE (" "\n" \ " attrib -r $OUTLIBDIR\$(TargetName).lib" "\n" \ " $SRCDIR\devtools\bin\gnu\touch.exe -d $QUOTE1999-01-01$QUOTE $OUTLIBDIR\$(TargetName).lib" "\n" \ " attrib +r $OUTLIBDIR\$(TargetName).lib" "\n" \ ")" "\n" \ - "$CRCCHECK" "\n" [!$SOURCESDK] + "$CRCCHECK" "\n" } - $PreLinkEvent + $PreLinkEvent [!$ANALYZE && !$SOURCESDK] { - $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTLIBDIR\$(TargetName).lib $SRCDIR" [!$SOURCESDK ] + $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $OUTLIBDIR\$(TargetName).lib $SRCDIR" } $Librarian @@ -64,13 +64,6 @@ $Configuration // Suppress this warning using the undocumented /ignore linker switch // schemalib.lib(schemaclassinfo.obj) : warning LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library $AdditionalOptions "$BASE /ignore:4221" - - // This option is from the devil. Basically, it causes the link inputs - // to vary depending on what is in the solution. This is anathema - // to the way that we use projects and solutions here at Valve. - // It also exposes a bug in VS2005 causing files to be recompiled/linked - // even if nothing changed. - $LinkLibraryDependencies "false" } } diff --git a/sp/src/vpc_scripts/source_lib_win32_debug.vpc b/sp/src/vpc_scripts/source_lib_win32_debug.vpc index a3eba728..981300da 100644 --- a/sp/src/vpc_scripts/source_lib_win32_debug.vpc +++ b/sp/src/vpc_scripts/source_lib_win32_debug.vpc @@ -6,17 +6,26 @@ $IgnoreRedundancyWarning "ON" -$MacroRequired "PLATSUBDIR" $MacroRequired "SRCDIR" $MacroRequired "OUTLIBNAME" $MacroRequired "OUTLIBDIR" +$MacroRequired "LIBPUBLIC" +$MacroRequired "LIBCOMMON" +$MacroRequired "PLATSUBDIR" +$MacroRequiredAllowEmpty "GAMENAME" +$MacroRequiredAllowEmpty "INTERMEDIATESUBDIR" +$MacroRequiredAllowEmpty "_UNITYSUBDIR" +$MacroRequiredAllowEmpty "_STATICSUBDIR" +$Macro "_SUBDIRSUFFIX" "$INTERMEDIATESUBDIR$_STATICSUBDIR$GAMENAME$PLATSUBDIR$_UNITYSUBDIR" $Configuration "Debug" { $General { // General - $IntermediateDirectory ".\Debug$PLATSUBDIR" + $OutputDirectory ".\Debug$_SUBDIRSUFFIX" [!$VS2010] + $OutputDirectory "$OUTLIBDIR" [$VS2010] + $IntermediateDirectory ".\Debug$_SUBDIRSUFFIX" $ExtensionsToDeleteOnClean $BuildLogFile $InheritedProjectPropertySheets @@ -48,8 +57,8 @@ $Configuration "Debug" // General $AdditionalIncludeDirectories "$SRCDIR\common;$SRCDIR\public;$SRCDIR\public\tier0;$SRCDIR\public\tier1" $Resolve#UsingReferences - $DebugInformationFormat "Program Database for Edit & Continue (/ZI)" [!$EANDCDISABLED && !$WIN64] - $DebugInformationFormat "Program Database (/Zi)" [$EANDCDISABLED || $WIN64] + $DebugInformationFormat "Program Database for Edit & Continue (/ZI)" [$WIN32] + $DebugInformationFormat "Program Database (/Zi)" [$WIN64] $SuppressStartupBanner $WarningLevel "Level 4 (/W4)" $Detect64bitPortabilityIssues "Yes (/Wp64)" @@ -66,7 +75,7 @@ $Configuration "Debug" $WholeProgramOptimization // Preprocessor - $PreprocessorDefinitions "_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" + $PreprocessorDefinitions "$BASE;_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" $IgnoreStandardIncludePath $GeneratePreprocessedFile $KeepComments @@ -86,7 +95,6 @@ $Configuration "Debug" $BufferSecurityCheck "Yes" $EnableFunctionLevelLinking $EnableEnhancedInstructionSet - $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)" [$WIN32] $FloatingPointModel "Fast (/fp:fast)" $EnableFloatingPointExceptions @@ -125,12 +133,12 @@ $Configuration "Debug" $ShowIncludes $UndefinePreprocessorDefinitions $UndefineAllPreprocessorDefinitions - $UseFullPaths + $UseFullPaths "Yes (/FC)" $OmitDefaultLibraryNames $ErrorReporting "Prompt Immediately (/errorReport:prompt)" - // Command Line - $AdditionalOptions "$BASE /MP" + // Command Line (L4D adding /MP) + $AdditionalOptions "/MP" [$VS2005] } $Librarian @@ -199,4 +207,4 @@ $Configuration "Debug" $Outputs $AdditionalDependencies } -} \ No newline at end of file +} diff --git a/sp/src/vpc_scripts/source_lib_win32_release.vpc b/sp/src/vpc_scripts/source_lib_win32_release.vpc index 8f80eefc..c3138590 100644 --- a/sp/src/vpc_scripts/source_lib_win32_release.vpc +++ b/sp/src/vpc_scripts/source_lib_win32_release.vpc @@ -6,17 +6,34 @@ $IgnoreRedundancyWarning "ON" -$MacroRequired "PLATSUBDIR" +// Disable frame pointer omission to allow fast stack walking, necessary for +// good ETW profiling. +$Macro NOFPO "1" + $MacroRequired "SRCDIR" $MacroRequired "OUTLIBNAME" $MacroRequired "OUTLIBDIR" +$MacroRequired "LIBPUBLIC" +$MacroRequired "LIBCOMMON" +$MacroRequired "PLATSUBDIR" +$MacroRequiredAllowEmpty "GAMENAME" +$MacroRequiredAllowEmpty "INTERMEDIATESUBDIR" +$MacroRequiredAllowEmpty "_UNITYSUBDIR" +$MacroRequiredAllowEmpty "_STATICSUBDIR" +$Macro "_SUBDIRSUFFIX" "$INTERMEDIATESUBDIR$_STATICSUBDIR$GAMENAME$PLATSUBDIR$_UNITYSUBDIR" $Configuration "Release" { $General { // General - $IntermediateDirectory ".\Release$PLATSUBDIR" + $OutputDirectory ".\Release$_SUBDIRSUFFIX" [!$VS2010 && !$RETAIL && !$PROFILE] + $OutputDirectory ".\Retail$_SUBDIRSUFFIX" [!$VS2010 && $RETAIL] + $OutputDirectory ".\Profile$_SUBDIRSUFFIX" [!$VS2010 && !$RETAIL && $PROFILE] + $OutputDirectory "$OUTLIBDIR" [$VS2010] + $IntermediateDirectory ".\Release$_SUBDIRSUFFIX" [!$RETAIL && !$PROFILE] + $IntermediateDirectory ".\Retail$_SUBDIRSUFFIX" [$RETAIL] + $IntermediateDirectory ".\Profile$_SUBDIRSUFFIX" [!$RETAIL && $PROFILE] $ExtensionsToDeleteOnClean $BuildLogFile $InheritedProjectPropertySheets @@ -28,7 +45,7 @@ $Configuration "Release" $MinimizeCRTUseInATL $CharacterSet "Use Multi-Byte Character Set" $CommonLanguageRuntimeSupport - $WholeProgramOptimization + $WholeProgramOptimization "Use Link Time Code Generation" [$LTCG] } $Debugging @@ -65,9 +82,8 @@ $Configuration "Release" $WholeProgramOptimization // Preprocessor - $PreprocessorDefinitions "WIN32;_WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" - // Enable asserts in release builds if /define:releaseasserts is specified on the VPC command line. - $PreprocessorDefinitions "$BASE;RELEASEASSERTS" [$RELEASEASSERTS] + $PreprocessorDefinitions "$BASE;WIN32;_WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" + $PreprocessorDefinitions "$BASE;RELEASE_ASSERTS" [$RELEASEASSERTS] $IgnoreStandardIncludePath $GeneratePreprocessedFile $KeepComments @@ -80,11 +96,10 @@ $Configuration "Release" $BasicRuntimeChecks $RuntimeLibrary "Multi-threaded (/MT)" $StructMemberAlignment - $BufferSecurityCheck "Yes" [$STAGING_ONLY] - $BufferSecurityCheck "No" [!$STAGING_ONLY] + $BufferSecurityCheck "No" [$RETAIL] + $BufferSecurityCheck "Yes" [!$RETAIL] $EnableFunctionLevelLinking "Yes (/Gy)" $EnableEnhancedInstructionSet - $EnableEnhancedInstructionSet "Streaming SIMD Extensions (/arch:SSE)" [$WIN32] $FloatingPointModel "Fast (/fp:fast)" $EnableFloatingPointExceptions @@ -123,14 +138,15 @@ $Configuration "Release" $ShowIncludes $UndefinePreprocessorDefinitions $UndefineAllPreprocessorDefinitions - $UseFullPaths + $UseFullPaths "Yes (/FC)" $OmitDefaultLibraryNames $ErrorReporting "Prompt Immediately (/errorReport:prompt)" - // Command Line - $AdditionalOptions "$BASE /MP" + // Command Line (L4D adding /MP) + $AdditionalOptions "/MP" // Enable extra debugging information. - $AdditionalOptions "$BASE /d2Zi+" + $AdditionalOptions "$BASE /d2Zi+" [$VS2010] + $AdditionalOptions "$BASE /Oy-" [$NOFPO] } $Librarian @@ -199,4 +215,4 @@ $Configuration "Release" $Outputs $AdditionalDependencies } -} \ No newline at end of file +} diff --git a/sp/src/vpc_scripts/source_linux_base_project.vpc b/sp/src/vpc_scripts/source_linux_base_project.vpc index 8dd136ba..f7fd40d5 100644 --- a/sp/src/vpc_scripts/source_linux_base_project.vpc +++ b/sp/src/vpc_scripts/source_linux_base_project.vpc @@ -1,4 +1,9 @@ +$Include "$SRCDIR\vpc_scripts\version.vpc" +$Macro PLATSUBDIR "\linux32" [$LINUX32] + +$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" $MacroRequired "SRCDIR" @@ -8,7 +13,7 @@ $Configuration "Debug" $Compiler { $PreprocessorDefinitions "DEBUG;_DEBUG" - $OptimizerLevel "-gdwarf-2 -g $(OptimizerLevel_CompilerSpecific)" + $OptimizerLevel "-gdwarf-2 -g2 $(OptimizerLevel_CompilerSpecific)" } } @@ -18,7 +23,7 @@ $Configuration "Release" { $PreprocessorDefinitions "NDEBUG" $PreprocessorDefinitions "$BASE;RELEASEASSERTS" [$RELEASEASSERTS] - $OptimizerLevel "-gdwarf-2 -g $(OptimizerLevel_CompilerSpecific)" + $OptimizerLevel "-gdwarf-2 -g2 $(OptimizerLevel_CompilerSpecific)" } } @@ -32,23 +37,14 @@ $Configuration $Compiler { $AdditionalIncludeDirectories "$SRCDIR\common;$SRCDIR\public;$SRCDIR\public\tier0;$SRCDIR\public\tier1" - $AdditionalIncludeDirectories "$BASE;/usr/include/malloc" [$OSX] - $PreprocessorDefinitions "$BASE;POSIX;GNUC" + $PreprocessorDefinitions "$BASE;GNUC;POSIX;COMPILER_GCC;MEMOVERRIDE_MODULE=$PROJECTNAME;_DLL_EXT=$_DLL_EXT" $PreprocessorDefinitions "$BASE;DEDICATED" [$DEDICATED] - $PreprocessorDefinitions "$BASE;LINUX;_LINUX" [$LINUXALL] - $PreprocessorDefinitions "$BASE;_OSX;OSX;_DARWIN_UNLIMITED_SELECT;FD_SETSIZE=10240;" [$OSX32 || $OSX64] - $PreprocessorDefinitions "$BASE;_DEMO" [$DEMO] + $PreprocessorDefinitions "$BASE;_LINUX;LINUX" [$LINUXALL] $SymbolVisibility "hidden" [$POSIX] - $GCC_ExtraCompilerFlags "$BASE -U_FORTIFY_SOURCE" [$LINUXALL] - $GCC_ExtraCompilerFlags "$BASE -faddress-sanitizer" [$ADDRESSSANITIZER && $LINUXALL] - - // Pass on appropriate branch define to preprocessor - $PreprocessorDefinitions "$BASE;STAGING_ONLY" [$STAGING_ONLY] - $PreprocessorDefinitions "$BASE;TF_BETA" [$TF_BETA] - } - $Linker - { - $GCC_ExtraLinkerFlags "$BASE -faddress-sanitizer" [$ADDRESSSANITIZER && $LINUXALL] + $PreprocessorDefinitions "$BASE;POSIX;_POSIX" [$POSIX] + + $GCC_ExtraCompilerFlags "-U_FORTIFY_SOURCE" [$LINUXALL] + $Create/UsePCHThroughFile "stdafx.h" } } @@ -56,9 +52,8 @@ $Project { $Folder "Link Libraries" { - $ImpLib tier0 [!$IS_LIB_PROJECT] - $Lib tier1 [!$IS_LIB_PROJECT] - $ImpLib vstdlib [!$IS_LIB_PROJECT] - $Lib $SRCDIR/thirdparty/clang+llvm-3.1-x86-linux-ubuntu_12.04/lib/clang/3.1/lib/linux/libclang_rt.asan-i386 [$ADDRESSSANITIZER && $LINUXALL] + $ImpLib "$LIBPUBLIC\tier0" [!$IS_LIB_PROJECT] + $Lib "$LIBPUBLIC\tier1" [!$IS_LIB_PROJECT] + $ImpLib "$LIBPUBLIC\vstdlib" [!$IS_LIB_PROJECT] } } diff --git a/sp/src/vpc_scripts/source_mll_qt_base.vpc b/sp/src/vpc_scripts/source_mll_qt_base.vpc new file mode 100644 index 00000000..099c658f --- /dev/null +++ b/sp/src/vpc_scripts/source_mll_qt_base.vpc @@ -0,0 +1,35 @@ +//====== Copyright (c) 1996-2010, Valve Corporation, All rights reserved. ===== +// +// Maya Plugin For Win32 - Same As source_dll_qt_win32_base.vpc except: +// * QT_ROOT is left unspecified, the part VPC script needs to define it +// as it varies with the version of Maya +// * QT_NO_DEBUG is always defined. +// * Only release versions of Qt libraries are linked +// Maya is linked with release Qt libs, linking a plug-in with debug +// libs will crash when a Qt widget is created +// +//============================================================================= + +$MacroRequired "QT_ROOT" + +$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc" +$Include "$SRCDIR\vpc_scripts\qt_base.vpc" + +$Configuration +{ + $Compiler + { + $AdditionalIncludeDirectories "$BASE;.\;$QT_ROOT\include;.\$QT_TARGET_SUBDIR" + $PreprocessorDefinitions "$BASE;QT_LARGEFILE_SUPPORT;QT_DLL;QT_GUI_LIB;QT_CORE_LIB;QT_THREAD_SUPPORT;QT_NO_DEBUG" + $DisableSpecificWarnings "4127;4512;$BASE" + } +} + +$Project +{ + $Folder "Link Libraries" + { + $Lib "$QT_ROOT\lib\qtcore4" + $Lib "$QT_ROOT\lib\qtgui4" + } +} diff --git a/sp/src/vpc_scripts/source_posix_base.vpc b/sp/src/vpc_scripts/source_posix_base.vpc index 0db13bcb..8e0fc436 100644 --- a/sp/src/vpc_scripts/source_posix_base.vpc +++ b/sp/src/vpc_scripts/source_posix_base.vpc @@ -1,14 +1,8 @@ +$Include "$SRCDIR\vpc_scripts\version.vpc" -$Macro PLATSUBDIR "\linux32" [$LINUX32] -//$Macro PLATSUBDIR "\linux64" [$LINUX64] -$Macro PLATSUBDIR "\osx32" [$OSX32] -$Macro PLATSUBDIR "\osx64" [$OSX64] - -$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" [$LINUX] -$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" [$LINUX] - - +$Macro LIBPUBLIC "$SRCDIR\lib\public$PLATSUBDIR" +$Macro LIBCOMMON "$SRCDIR\lib\common$PLATSUBDIR" $MacroRequired "SRCDIR" @@ -17,8 +11,8 @@ $Configuration "Debug" { $Compiler { - $PreprocessorDefinitions "DEBUG;_DEBUG" - $OptimizerLevel "-gdwarf-2 -g $(OptimizerLevel_CompilerSpecific)" + $PreprocessorDefinitions "$BASE;DEBUG;_DEBUG" + $OptimizerLevel "-gdwarf-2 -g2 $(OptimizerLevel_CompilerSpecific)" } } @@ -26,8 +20,8 @@ $Configuration "Release" { $Compiler { - $PreprocessorDefinitions "NDEBUG" - $OptimizerLevel "-gdwarf-2 -g $(OptimizerLevel_CompilerSpecific)" + $PreprocessorDefinitions "$BASE;NDEBUG" + $OptimizerLevel "-gdwarf-2 -g2 $(OptimizerLevel_CompilerSpecific)" } } @@ -41,32 +35,37 @@ $Configuration $Compiler { $AdditionalIncludeDirectories "$SRCDIR\common;$SRCDIR\public;$SRCDIR\public\tier0;$SRCDIR\public\tier1" - $PreprocessorDefinitions "$BASE;GNUC;POSIX" + $AdditionalLibraryDirectories "$LIBCOMMON;$LIBPUBLIC" [$OSXALL] + $PreprocessorDefinitions "$BASE;GNUC;POSIX;COMPILER_GCC;_DLL_EXT=$_DLL_EXT" $PreprocessorDefinitions "$BASE;DEDICATED" [$DEDICATED] // the 10240 in the following line is the output of `sysctl -n kern.maxfilesperproc` - $PreprocessorDefinitions "$BASE;_OSX;OSX;_DARWIN_UNLIMITED_SELECT;FD_SETSIZE=10240;" [$OSX32 || $OSX64] - $PreprocessorDefinitions "$BASE;_LINUX;LINUX;" [$LINUX] - $PreprocessorDefinitions "$BASE;_CYGWIN;CYGWIN;" [$CYGWIN] + $PreprocessorDefinitions "$BASE;_OSX;OSX;_DARWIN_UNLIMITED_SELECT;FD_SETSIZE=10240;" [$OSXALL] + $PreprocessorDefinitions "$BASE;OVERRIDE_V_DEFINES" [$OSXALL] + $PreprocessorDefinitions "$BASE;_LINUX;LINUX;" [$LINUXALL] + $SymbolVisibility "hidden" [$POSIX] + $PreprocessorDefinitions "$BASE;POSIX;_POSIX" [$POSIX] - // Pass on appropriate branch define to preprocessor - $PreprocessorDefinitions "$BASE;STAGING_ONLY" [$STAGING_ONLY] - $PreprocessorDefinitions "$BASE;TF_BETA" [$TF_BETA] + $PreprocessorDefinitions "$BASE;PLATFORM_64BITS" [$OSX64] + $GCC_ExtraCompilerFlags "$BASE -arch x86_64" [$OSX64] $Create/UsePCHThroughFile "stdafx.h" } + + $Linker + { + $GCC_ExtraLinkerFlags "$BASE -arch x86_64" [$OSX64] + } + } $Project { - $Folder "Link Libraries" + $Folder "Link Libraries" { - $ImpLib tier0 [$LINUXALL] - $Lib tier1 [$LINUXALL] - $ImpLib vstdlib [$LINUXALL] - $DynamicFile "$SRCDIR\lib\$PLATFORM\$_IMPLIB_PREFIXtier0$_IMPLIB_EXT" [!$LINUXALL] - $DynamicFile "$SRCDIR\lib\$PLATFORM\$_IMPLIB_PREFIXvstdlib$_IMPLIB_EXT" [!$LINUXALL] - $DynamicFile "$SRCDIR\lib\$PLATFORM\tier1$_STATICLIB_EXT" [!$LINUXALL] + $ImpLib "$LIBPUBLIC\tier0" [!$IS_LIB_PROJECT] + $Lib "$LIBPUBLIC\tier1" [!$IS_LIB_PROJECT] + $ImpLib "$LIBPUBLIC\vstdlib" [!$IS_LIB_PROJECT] } } - + diff --git a/sp/src/vpc_scripts/source_video_base.vpc b/sp/src/vpc_scripts/source_video_base.vpc index dd7f3653..4ccafb63 100644 --- a/sp/src/vpc_scripts/source_video_base.vpc +++ b/sp/src/vpc_scripts/source_video_base.vpc @@ -16,18 +16,15 @@ //----------------------------------------------------------------------------- -// We use Quicktime exclusively (and usually only quicktime) on the Mac +// We use Quicktime exclusively (and only quicktime) on the Mac // // We have two configurations for Win32. -// -// if the QUICKTIME_WIN32 Macro is enabled, QuickTime operation is enabled, along with Bink, AVI, and WMV video -// if the QUICKTIME_WIN32 Macro is not enabled, we only build for Bink, AVI and WMV -// -// On the Mac OSX we enable Quicktime only, and set the FORCE_QUICKTIME define, which causes requests to play -// other media file types to look for a quicktime compatible version of the media file first -// +// +// 1) Comment out the following $macro line out to enable BINK (and AVI and WMV) playback of videos +// 2) Uncomment the following $macro line out to enable Quicktime (and AVI and WMV) playback of videos and +// - the Quicktime file override ( the Quicktime .mov is played if present even if a .bnk, .avi or .wmv file was specified ) -//$Macro QUICKTIME_WIN32 1 [$WIN32 && !$X360] +// $macro QUICKTIME_WIN32 1 $Macro GL "1" [!$DEDICATED && !$WIN32 && !$WIN64] // If we're using OpenGL, we're implicitly using SDL. @@ -37,34 +34,17 @@ $Configuration { $Compiler { - // OSX Builds - $PreprocessorDefinitions "$BASE;QUICKTIME_VIDEO;FORCE_QUICKTIME" [$OSXALL] + $PreprocessorDefinitions "$BASE;QUICKTIME_VIDEO;FORCE_QUICKTIME" [$OSXALL] // Windows PC, without Quicktime, and with Quicktime - $PreprocessorDefinitions "$BASE;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO" [$WIN32 && !$X360 && !$QUICKTIME_WIN32] - $PreprocessorDefinitions "$BASE;AVI_VIDEO;WMV_VIDEO;QUICKTIME_VIDEO" [$WIN32 && !$X360 && $QUICKTIME_WIN32] - - // Xbox 360 builds - $PreprocessorDefinitions "$BASE;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO" [$X360] - // Linux + $PreprocessorDefinitions "$BASE;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO" [$WIN32&&!$QUICKTIME_WIN32] + $PreprocessorDefinitions "$BASE;AVI_VIDEO;WMV_VIDEO;QUICKTIME_VIDEO" [$WIN32&&$QUICKTIME_WIN32] + $PreprocessorDefinitions "$BASE;BINK_VIDEO" [$X360] $PreprocessorDefinitions "$BASE;BINK_VIDEO" [$LINUXALL] - - // OpenGL - $PreprocessorDefinitions "$BASE;GL_GLEXT_PROTOTYPES;DX_TO_GL_ABSTRACTION" [$GL] - - // SDL - $PreprocessorDefinitions "$BASE;USE_SDL" [$SDL] + + $PreprocessorDefinitions "$BASE;GL_GLEXT_PROTOTYPES;DX_TO_GL_ABSTRACTION" [$GL] + $PreprocessorDefinitions "$BASE;USE_SDL" [$SDL] $AdditionalIncludeDirectories "$BASE;$SRCDIR\thirdparty\SDL2" [$SDL || $DEDICATED] } - } - -$Project -{ - $Folder "Link Libraries" [$OSXALL && $SDL] - { - $DynamicFile "$SRCDIR\lib\public\$PLATFORM\$_IMPLIB_PREFIXSDL2$_IMPLIB_EXT" - } -} - diff --git a/sp/src/vpc_scripts/source_win32_base.vpc b/sp/src/vpc_scripts/source_win32_base.vpc index 04ef53b8..4c509098 100644 --- a/sp/src/vpc_scripts/source_win32_base.vpc +++ b/sp/src/vpc_scripts/source_win32_base.vpc @@ -1,12 +1,13 @@ $Configuration { - $General [$VS2012] + $General { - // Request the VS 11 (VS 2012) compiler toolset. - $PlatformToolset "v110" + // Request a specific compiler toolset. + $PlatformToolset "v110" [$VS2012] // VS 11 + $PlatformToolset "v120" [$VS2013] // VS 12 } - $General [$VS2010 || $VS2012] + $General { $ExecutableDirectories "$(ExecutablePath);$(Path)" // We need to override mt.exe for Win7 compatibiity. Append paths before $(ExecutablePath) if you need VS to use your tools rather than its own @@ -14,11 +15,14 @@ $Configuration // VS 2012 compiles fine but does not link. We want to redirect to stub versions of // the tools (like link.exe and mt.exe) so that the link stage will be NOPed when // doing /analyze builds. - $ExecutableDirectories "$SRCDIR\devtools\vs_nop_tools;$BASE" [$ANALYZE && $VS2012] + $ExecutableDirectories "$SRCDIR\devtools\vs_nop_tools;$BASE" [$ANALYZE && ($VS2012 || $VS2013)] } $Compiler { + // warning C4316: object allocated on the heap may not be aligned 16 + $DisableSpecificWarnings "$BASE;4316" [$VS2013] + // When using /analyze (triggered with /define:ANALYZE on the vpc command line) we want // to use /MP but not at its most aggressive setting, and we want to forcibly disable lots // of warnings (also disabled in platform.h but not everybody includes that). @@ -26,11 +30,13 @@ $Configuration // warning C6318: Ill-defined __try/__except: use of the constant EXCEPTION_CONTINUE_SEARCH -- bogus // warning C6322: Empty _except block // Set the stack size threshold to 100,000 to avoid noisy warnings on functions with modest stack usage - $AdditionalOptions "/MP3 /analyze /analyze:stacksize100000 /wd6308 /wd6255 /wd6387 /wd6309 /wd6011 /wd6211 /wd6031 /wd6326 /wd6239 " \ - "/wd6285 /wd6237 /wd6235 /wd6240 /wd6323 /wd6326 /wd6335 /wd6320 /wd6250 /wd6384 /wd6318 /wd6322" [$ANALYZE] + // Note that /analyze for VS 2010 only works with the 32-bit compiler, but for VS 2012 it works on 64-bit + // as well. + $DisableSpecificWarnings "$BASE;6308;6255;6387;6309;6011;6211;6031;6326;6239;6285;6237;6235;6240;6323;6326;6335;6320;6250;6384;6318;6322" [$ANALYZE] + $AdditionalOptions "$BASE /MP3 /analyze /analyze:stacksize100000" [$ANALYZE] // Specify /define:ALLOWSHADOWING to suppress variable shadowing warnings - $AdditionalOptions "$BASE /wd6244 /wd6246" [$ANALYZE && $ALLOWSHADOWING] + $DisableSpecificWarnings "$BASE;6244;6246" [$ANALYZE && $ALLOWSHADOWING] // New warnings in VS 2012 that we want to ignore. // warning C4005: 'DXGI_STATUS_OCCLUDED' : macro redefinition @@ -46,22 +52,15 @@ $Configuration // warning C28301: No annotations for first declaration of 'InitializeCriticalSection'. See d:\clients\tf3\staging\src\public\tier0\threadtools.h(1373). // warning C28195: The function was declared as acquiring memory in 'return' and exited without doing so. // warning C6340: Mismatch on sign: 'unsigned short' passed as parameter '6' when some signed type is required in call to 'V_snprintf'. - // warning C6330: 'const char' passed as parameter '1' when 'unsigned char' is required in call to 'isspace'. - $AdditionalOptions "$BASE /wd6014 /wd28159 /wd28182 /wd28183 /wd28197 /wd28198 /wd28204 /wd28247 /wd28251 /wd28301 /wd28195 /wd6340 /wd6330" [$ANALYZE && $VS2012] - - // Having lots of warnings makes it harder to notice new, and possibly - // important warnings, both on buildbot and in the output window. Lots - // of warnings also makes it harder to skip through errors in the output - // window since F8 stops on both warnings and errors. The only way to - // keep the warning count down is to have warnings-as-errors. - // We will not be warning free on 64-bit for a while... - $TreatWarningsAsErrors "Yes (/WX)" [!$ANALYZE && !$WIN64] + // This warning only applies to Windows XP in low-memory situations: + // warning C28125: The function 'InitializeCriticalSection' must be called from within a try\except block + // warning C28160: Error annotation: Calling VirtualFreeEx without the MEM_RELEASE flag frees memory but not address descriptors (VADs); results in address space leaks. + // warning C6248: Setting a SECURITY_DESCRIPTOR's DACL to NULL will result in an unprotected object. + // warning C6102: Using value from failed function call + $DisableSpecificWarnings "$BASE;6014;28159;28182;28183;28197;28198;28204;28247;28251;28301;28195;6340;28125;28160;6248;6102" [$ANALYZE && ($VS2012 || $VS2013)] - $PreprocessorDefinitions "$BASE;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64] + // Defines to differentiate 32 from 64 bit builds + $PreprocessorDefinitions "$BASE;PLATFORM_64BITS;WIN64;_WIN64;COMPILER_MSVC64" [$WIN64] $PreprocessorDefinitions "$BASE;COMPILER_MSVC32" [$WIN32] - - // Pass on appropriate branch define to preprocessor - $PreprocessorDefinitions "$BASE;STAGING_ONLY" [$STAGING_ONLY] - $PreprocessorDefinitions "$BASE;TF_BETA" [$TF_BETA] } } diff --git a/sp/src/vpc_scripts/version.vpc b/sp/src/vpc_scripts/version.vpc index dbefdb83..1aa2536a 100644 --- a/sp/src/vpc_scripts/version.vpc +++ b/sp/src/vpc_scripts/version.vpc @@ -9,4 +9,4 @@ // file will cause the CRC checking to fail, and thus cause a rebuild. // DO NOT CHANGE THIS UNLESS YOU !!!REALLY!!! NEED TO FORCE EVERY SINGLE VCPROJ TO REGENERATE -$Macro "InternalVersion" "101" \ No newline at end of file +$Macro "InternalVersion" "104" \ No newline at end of file -- cgit v1.2.3