premake-ninja icon indicating copy to clipboard operation
premake-ninja copied to clipboard

fixed buildcommand not haveing project working directory

Open LostbBlizzard opened this issue 1 year ago • 3 comments

there may be a cleaner way to fix this issue.

LostbBlizzard avatar Oct 19 '24 02:10 LostbBlizzard

Can you share a problematic config? I tried modifying https://github.com/Jarod42/premake-sample-projects/tree/master/projects/project-04-prepost-build to have project location as workspace-location+"project" and it worked.

Jarod42 avatar Oct 19 '24 15:10 Jarod42

Can you share a problematic config? I tried modifying https://github.com/Jarod42/premake-sample-projects/tree/master/projects/project-04-prepost-build to have project location as workspace-location+"project" and it worked.

I simplified my project premake5.lua to https://github.com/LostbBlizzard/premake-problematic-ninja-example. compare the ninja plugin to premake gmake2 and see the difference. here the original if you need it.

also may need to run ninja subproject1_Debug_linux64 first because pre_cmd does not wait for dependency.

the believe the issue is from the include function

LostbBlizzard avatar Oct 19 '24 20:10 LostbBlizzard

As mentionned in Tokens#path-in-commands, you have to use %[..], i.e: prebuildcommands { "%[" .. ProgramPath .."] pwdcmd" }.

Jarod42 avatar Oct 20 '24 10:10 Jarod42