You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing token replacement (in pre/post buildcommand, custom rule, custom commands, ...), all paths are shown relative with every generator, even "%{file.abspath}". There is ! (i.e "%{file.path}") to explicit show absolute path.
I also see undocumented %[path] to explicitly spot path in command line (which allows to write path normally in command, and not relative to project).
i.e
location("solution") -- ensure premake.5.lua is not in same directory than project.-- Strangeprebuildcommands { "{ECHO} %{cfg.buildtarget.abspath}" } -- bin/Debug/app.exe -- relative to project locationprebuildcommands { "{ECHO} %{cfg.buildtarget.directory}" } -- bin/Debug -- relative to project location-- OKprebuildcommands { "{ECHO} %{!cfg.buildtarget.abspath}" } -- _MAIN_SCRIPT_DIR .. /solution/ .. bin/debug/app.exeprebuildcommands { "{ECHO} %{!cfg.buildtarget.directory}" } -- _MAIN_SCRIPT_DIR .. /solution/ .. bin/debug-- write path relative to premakeprebuildcommands { "{ECHO} %[test]" } -- "../test" -- and got (quoted) result relative to project location-- WRONGprebuildcommands { "{ECHO} %[%{cfg.buildtarget.abspath}]" } -- "../bin/debug/app.exe" -- relative to project locationprebuildcommands { "{ECHO} %[%{cfg.buildtarget.directory}]" } -- "../bin/debug" -- relative to project location-- Correctprebuildcommands { "{ECHO} %[%{!cfg.buildtarget.abspath}]" } -- "bin/debug/app.exe" -- relative to project locationprebuildcommands { "{ECHO} %[%{!cfg.buildtarget.directory}]" } -- "bin/debug" -- relative to project location
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Testing token replacement (in pre/post buildcommand, custom rule, custom commands, ...), all paths are shown relative with every generator, even
"%{file.abspath}"
. There is!
(i.e"%{file.path}"
) to explicit show absolute path.I also see undocumented
%[path]
to explicitly spot path in command line (which allows to write path normally in command, and not relative to project).i.e
I currently list 4 absolute paths:
"%{file.directory}"
"%{file.abspath}"
Do we have some guideline?
Can be added for each generators, but doesn't seems clean.
Is
.absolutepath
needed (i.e use!
when required instead)?Shouldn't we have
%[!path]
?Beta Was this translation helpful? Give feedback.
All reactions