Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.6 KiB

  1. //-----------------------------------------------------------------------------
  2. // VSTDLIB.VPC
  3. //
  4. // Project Script
  5. //-----------------------------------------------------------------------------
  6. $Macro SRCDIR ".."
  7. $Macro OUTBINDIR "$SRCDIR\..\game\bin"
  8. $include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
  9. $MacroRequired "PLATSUBDIR"
  10. $Configuration
  11. {
  12. $General
  13. {
  14. // X360 version publishes to some other directory then copies here so we need to tell VPC to track this
  15. // or else it won't know what depends on this project.
  16. $AdditionalOutputFiles "$SRCDIR\lib\public\$(TargetName).lib" [$X360]
  17. }
  18. $Compiler
  19. {
  20. $PreprocessorDefinitions "$BASE;VSTDLIB_DLL_EXPORT"
  21. $GCC_ExtraCompilerFlags "-U_FORTIFY_SOURCE" [$LINUXALL]
  22. }
  23. $Linker
  24. {
  25. $AdditionalDependencies "$BASE odbc32.lib odbccp32.lib" [$WINDOWS]
  26. // pc publishes the import library directly
  27. $ImportLibrary "$LIBPUBLIC\$(TargetName).lib" [$WINDOWS]
  28. // 360 publishes the import library via a post build step
  29. $ImportLibrary "$(TargetDir)\$(TargetName).lib" [$X360]
  30. // 360 will auto generate a def file for this import library
  31. $ModuleDefinitionFile " " [$X360]
  32. $AdditionalOptions "$BASE /AUTODEF:xbox\xbox.def" [$X360]
  33. // Suppress this warning using the undocumented /ignore linker switch
  34. // tier1.lib(KeyValues.obj) : warning LNK4217: locally defined symbol _KeyValuesSystem imported in function "public: static int __cdecl KeyValues::GetSymbolForStringClassic(char const *,bool)" (?GetSymbolForStringClassic@KeyValues@@SAHPBD_N@Z)
  35. $AdditionalOptions "$BASE /ignore:4217" [$WINDOWS]
  36. $SystemLibraries "iconv" [$OSXALL]
  37. $SystemFrameworks "CoreServices" [$OSXALL]
  38. $GCC_ExtraLinkerFlags "-all_load" [$OSXALL]
  39. $ImportLibrary "$LIBPUBLIC\$_IMPLIB_PREFIX$OUTBINNAME$_IMPLIB_EXT" [$POSIX]
  40. $OutputFile "$(OBJ_DIR)/$_IMPLIB_PREFIX$OUTBINNAME$_IMPLIB_EXT" [$POSIX]
  41. }
  42. $PreLinkEvent [$WINDOWS]
  43. {
  44. $CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $LIBPUBLIC\$(TargetName).lib $SRCDIR" "\n" \
  45. "$BASE"
  46. }
  47. $PreLinkEvent [$X360]
  48. {
  49. // Run a pre-link event to clean the .def file from the last link
  50. $CommandLine "if exist xbox\xbox.def del xbox\xbox.def" "\n" \
  51. "$BASE"
  52. }
  53. $PostBuildEvent [$X360]
  54. {
  55. // Run a post build event to validate the .def file was correctly generated
  56. $CommandLine "perl $SRCDIR\devtools\bin\make360def.pl -checkauto xbox\xbox.def" "\n" \
  57. "if exist $(TargetDir)$(TargetName).lib copy $(TargetDir)$(TargetName).lib $SRCDIR\lib\public\$(TargetName).lib" "\n" \
  58. "$BASE"
  59. }
  60. $General [$POSIX]
  61. {
  62. $GameOutputFile "$OUTBINDIR/$_IMPLIB_DLL_PREFIX$OUTBINNAME$_DLL_EXT"
  63. }
  64. }
  65. $Project "vstdlib"
  66. {
  67. $Folder "Source Files"
  68. {
  69. $File "xbox\___FirstModule.cpp" [$X360]
  70. $File "GetStackPtr64.masm" [$WIN64]
  71. {
  72. $Configuration
  73. {
  74. $CustomBuildStep
  75. {
  76. // General
  77. $CommandLine "$QUOTE$(VCInstallDir)bin\x86_amd64\ml64.exe$QUOTE /nologo /c /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE"
  78. $Description "Compiling GetStackPtr64.masm"
  79. $Outputs "$(IntDir)\$(InputName).obj"
  80. }
  81. }
  82. }
  83. $File "coroutine_win64.masm" [$WIN64]
  84. {
  85. $Configuration
  86. {
  87. $CustomBuildStep
  88. {
  89. // General
  90. $CommandLine "$QUOTE$(VCInstallDir)bin\x86_amd64\ml64.exe$QUOTE /c /Fo$QUOTE$(IntDir)\$(InputName).obj$QUOTE $QUOTE$(InputPath)$QUOTE"
  91. $Description "Compiling coroutine_win64.masm"
  92. $Outputs "$(IntDir)\$(InputName).obj"
  93. }
  94. }
  95. }
  96. $File "coroutine.cpp" [!$X360 && !$OSXALL]
  97. {
  98. $Configuration
  99. {
  100. $Compiler
  101. {
  102. $BasicRuntimeChecks "Default"
  103. }
  104. }
  105. }
  106. $File "cvar.cpp"
  107. $File "jobthread.cpp"
  108. $File "KeyValuesSystem.cpp"
  109. $File "osversion.cpp"
  110. $File "processutils.cpp" [$WINDOWS]
  111. $File "random.cpp"
  112. $File "vcover.cpp"
  113. }
  114. $Folder "Public Header Files"
  115. {
  116. $File "$SRCDIR\public\vstdlib\cvar.h"
  117. $File "$SRCDIR\public\vstdlib\coroutine.h"
  118. $File "$SRCDIR\public\vstdlib\jobthread.h"
  119. $File "$SRCDIR\public\vstdlib\IKeyValuesSystem.h"
  120. $File "$SRCDIR\public\vstdlib\iprocessutils.h"
  121. $File "$SRCDIR\public\tier1\mempool.h"
  122. $File "$SRCDIR\public\vstdlib\osversion.h"
  123. $File "$SRCDIR\public\vstdlib\random.h"
  124. $File "$SRCDIR\public\vstdlib\vcover.h"
  125. $File "$SRCDIR\public\vstdlib\vstdlib.h"
  126. }
  127. $Folder "Link Libraries"
  128. {
  129. -$ImpLib vstdlib
  130. $Lib "coroutine_osx" [$OSXALL]
  131. }
  132. }