GENie
GENie copied to clipboard
Adding config based token replacement to paths
Any plans on adding the config based token replacement support to paths that the later premake stuff started doing? This allows for things like:
targetdir "path/%{cfg.platform}"
instead of the current:
configuration "x32" targetdir "path/x32" configuration "x64" targetdir "path/x64"
Not really. This is fairly trivial to setup. Check here how I'm doing it: https://github.com/bkaradzic/bx/blob/master/scripts/toolchain.lua
x32 is also completely misleading. It's 32-bit not x86. Also other platforms that have 32-bit/64-bit compilers usually split those into separate toolchains (for example: arm, aarch64).
Aren't you just manually listing them all out in that example? Or am I missing something?
Yeah, but once you setup toolchains, that's it, you just include toolchain.lua file.
Ideally I would put this toolchain.lua to be part of GENie.
Once you have bunch configurations it becomes obvious the targetdir should be something like:
<build dir>/<os>/<compiler>/<cpu>/<bitness>/<config>
or
<build dir>/<os>/<compiler>/<cpu+bitness>/<config>
There are two issues I hit there.
-
If you want a couple configuration based values in a path or file name (e.g. MyThing_Debug_x64.lib") the number of permutations gets large fast.
-
Anytime you want a project organized a bit differently (or if you just want to try some new structure in an existing project) you need to recreate this giant list of every permutation.
I tend to work around this currently by just baking that info into the command line options (which are accessible at path specification) and generating some extra solutions in situations where less should suffice. That make sense?
I haven't tried but I assume you can do this in lua script programmatically without changes to GENie scripts. Create function that will just fill up the configuration table with targetdirs "path/%{cfg.platform}".