VPC Scripts/Syntax

From Valve Developer Community
< VPC Scripts
Revision as of 19:15, 26 July 2025 by SomeoneTookSeven (talk | contribs) (Created page with "VPC Script files work in a fairly straightforward way. There are C-Style comments with <code>//</code>, Commands are issued with <code>$</code> and Scopes are made with <code>{ }</code>. Conditionals can also be made with <code>[condition]</code> __TOC__ === $BASE === <code style="display:block;background-color:#151515!important;padding:15px !important;border-radius:8px!important;font-family:monospace;border:1px solid #000 !important;margin-bottom:5px;"> <span style="co...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

VPC Script files work in a fairly straightforward way. There are C-Style comments with //, Commands are issued with $ and Scopes are made with { }. Conditionals can also be made with [condition]

$BASE

$BASE Magic word used to get values that already exist for command.

$Macro

$Macro NAME "VALUE" Defines a macro NAME with string VALUE

$MacroRequired

$MacroRequired "NAME" Macro NAME is required or VPC will error

$Include

$Include "PATH.vpc" includes another vpc file

$Configuration

$Configuration "CONFIG" { } declares configurations commands depending on what CONFIG were compiling for. If CONFIG is left blank it acts as a default or catch-all case

$General

$Configuration "" { $General { } } General Build Commands

$OutputDirectory

$Configuration "" { $General { $OutputDirectory "" } } directory location of finished build

$IntermediateDirectory

$Configuration "" { $General { $IntermediateDirectory "" } } Where to store temp build files for this config (like .obj)

$AdditionalIncludeDirectories

$Configuration "" { $Compiler { $AdditionalIncludeDirectories "<x>;<y>;..." } } Specifies extra folders to search for files during compilation. Multiples Options can be done in a single command seperated by ;

$PreprocessorDefinitions

$Configuration "" { $Compiler { $PreprocessorDefinitions "<x>;<y>;..." } } Defines macros #define passed to the compiler for conditional compilation.

$Create/UsePrecompiledHeader

$Configuration "" { $Compiler { $Create/UsePrecompiledHeader "Use Precompiled Header (/Yu)" } } Enables or specifies usage of a precompiled header (PCH) to speed up compilation.

$Create/UsePCHThroughFile

$Configuration "" { $Compiler { $Create/UsePCHThroughFile "cbase.h" } } Specifies the header file to use as the entry point when creating or using a precompiled header

$PrecompiledHeaderFile

$Configuration "" { $Compiler { $PrecompiledHeaderFile "" } } Sets the output path and name of the generated precompiled header

$DisableSpecificWarnings

$Configuration "" { $Compiler { $DisableSpecificWarnings "" } } Disables the number warning

$Linker

$Configuration "" { $Linker { } } Linker Commands

$SystemLibraries

$Configuration "" { $Linker { $SystemLibraries "" } } Specifies system libraries .lib to link

$SystemFrameworks

$Configuration "" { $Linker { $SystemFrameworks "" } } Specifies macOS system frameworks

$IgnoreImportLibrary

$Configuration "" { $Linker { $IgnoreImportLibrary "" } } Disables creation of a .lib import library when building a DLL.

$AdditionalDependencies

$Configuration "" { $Linker { $AdditionalDependencies "" } } Adds extra libraries to link with the project (beyond system and default ones).

$Project

$Project { } Sets up Project UI

$Folder

$Project { $Folder "Name" { } } Adds extra libraries to link with the project (beyond system and default ones).

$File

$Project { $Folder "Name" { $File "name.cpp" } } Adds extra libraries to link with the project (beyond system and default ones).

$Lib

$Project { $Folder "Name" { $Lib lib } } Specifies a static library file to include in the build

$ImpLibexternal

$Project { $Folder "Name" { $ImpLibexternal lib } } Specifies an external import library to use instead of generating one during DLL build

$Libexternal

$Project { $Folder "Name" { $Libexternal lib } } Specifies an external static library to link without building it as part of the project.