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

premake.path better way to add path in system.lua

Open lolrobbe2 opened this issue 2 months ago • 5 comments

to add support for libraries and modules to premake manager, the modules and libraries dir have to be added to the premake.path variable. this is done by auto generating a premake-system.lua script automaticaly.

---WARNING this file was generated by premake-manager-cli!!!
---change at your own risk!
premake.path = premake.path..";"..path.join(_MAIN_SCRIPT_DIR, "modules")
premake.path = premake.path..";"..path.join(_MAIN_SCRIPT_DIR, "libraries")
require "cmake"

What are you trying to do? i think there is a build in way to do this but can't find it

Anything else we should know? the premake-registry i have been working on is now live here. How would i add this to the premake docs?

(You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to issues like these!)

lolrobbe2 avatar Dec 12 '25 10:12 lolrobbe2

I'm not sure what you're asking for help with here?

samsinsane avatar Dec 12 '25 11:12 samsinsane

If there is a cleaner way to do this:

premake.path = premake.path..";"..path.join(_MAIN_SCRIPT_DIR

@samsinsane

lolrobbe2 avatar Dec 12 '25 11:12 lolrobbe2

Not that I'm aware of.

samsinsane avatar Dec 12 '25 12:12 samsinsane

@samsinsane thinking about this a bit more, gave me the following realisation that i could also add global install dir. for modules and libraries. but how does premake then select the correct version when i locally have another version also for "unexplained reasons".

lolrobbe2 avatar Dec 13 '25 22:12 lolrobbe2

From memory Premake will use the first one it finds, best way to find out would be to test it out.

samsinsane avatar Dec 14 '25 07:12 samsinsane

@samsinsane Closing as i haven't found a better answer. the registry is almost ready just need to finish up the work for the common registry.

lolrobbe2 avatar Dec 17 '25 22:12 lolrobbe2