nosoop / NinjaBuild-SMPlugin

Template to set up SourceMod plugin projects with Ninja
9 stars 2 forks source link

Write exact directory when generating build file #6

Open sticks-stuff opened 2 years ago

sticks-stuff commented 2 years ago

Running build.ninja using the -f flag in ninja from any other directory other than the directory it was originally configured in fails as it can't find the referenced includes. For example:

C:\Users\Charlotte>ninja -f l:\SM-TFCWXBaseAttributes\build.ninja
[1/2] Compiling "L:\tf2server\steamapps\common\Team Fortre...Server\tf\addons\sourcemod\plugins\viewmodel_override.smx"
FAILED: L:/tf2server/steamapps/common/Team Fortress 2 Dedicated Server/tf/addons/sourcemod/plugins/viewmodel_override.smx
L:\tf2server\steamapps\common\Team Fortress 2 Dedicated Server\tf\addons\sourcemod\scripting\spcomp.EXE L:\SM-TFCWXBaseAttributes\scripting\viewmodel_override.sp -iL:\SM-TFCWXBaseAttributes/scripting/include -h -v0 -ithird_party/include_submodules -ithird_party/vendored -o "L:\tf2server\steamapps\common\Team Fortress 2 Dedicated Server\tf\addons\sourcemod\plugins\viewmodel_override.smx"
L:\SM-TFCWXBaseAttributes\scripting\viewmodel_override.sp(23) : fatal error 183: cannot read from file: "stocksoup/tf/entity_prop_stocks"

Compilation aborted.
1 Error.

This fixes that, but it might be worth hiding this behind another command line argument, like --portable, as it does make resulting build files look ugly.