premake - premake5 how to set outdir based on platform + configuration? -


i'd set outdir/targetdir each combination of platform + configuration.

function setlibtargetdir(platforms, configs) i2,c in ipairs(configs)         i,p in ipairs(platforms)             filter ("configurations:" .. c, "platforms:" .. p)                 targetdir("bin/" .. p .. "/" .. c)                 libdirs ("bin/" .. p .. "/" .. c)                 libdirs ("bin_prebuilt/" .. p .. "/" .. c)--manually generated libs/dlls premake5 can't handle      end end end  setlibtargetdir({"win32", "win64"}, {"debug", "release", "final"}) 

i tried using code, while gets config right(debug/release/final). places in win64, 32 bit files & 64 files end in same directory.

what doing wrong here? i'd each combination of platform + configuration have own output dir , library paths.

thanks

stumbled across answer:

https://github.com/premake/premake-core/wiki/tokens

"%{cfg.buildcfg}" config "%{cfg.platform}" gets platform

so code works:

targetdir("bin/" .. "%{cfg.platform}" .. "/" .. "%{cfg.buildcfg}") libdirs("bin/" .. "%{cfg.platform}" .. "/" .. "%{cfg.buildcfg}") libdirs("bin_prebuilt/" .. "%{cfg.platform}" .. "/" .. "%{cfg.buildcfg}") 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -