How to change libdirs priority in premake?

379 views Asked by At

I have the following lines in my premake4.lua file

platforms { "x32", "x64" }
...
libdirs { "../deps/linux/lib64" }

Then the generated Makefile will contain:

LDFLAGS   += -m64 -L/usr/lib64 -L../deps/linux/lib64

Is it possible to prioritize my custom library dir? I mean I want the following line:

LDFLAGS   += -m64 -L../deps/linux/lib64 -L/usr/lib64

I'm using premake4 but I can switch to premake5 if needed.

1

There are 1 answers

0
J. Perkins On BEST ANSWER

In Premake4, you can add this to your project file:

premake.gcc.platforms.x64.ldflags = "-L../deps/linux/lib64 -L/usr/lib64"

In Premake5, you can do this:

premake.tools.gcc.libraryDirectories.architecture.x86_64 = { "-L../deps/linux/lib64", "-L/usr/lib64" }

Though it would clearly be better if you didn't have to do that. If you could open an issue ticket and link it to this discussion I can look into swapping those variables around in the code.