How to generate .so and .a file one time in premake

310 views Asked by At

I am using premake, but do not know how to build .so and .a files during one compilation. kind only accepts one argument, either "SharedLib" or "StaticLib". I do not want to compile the same project twice just for generating different types of lib files.

1

There are 1 answers

0
J. Perkins On

Your best bet would probably be to set up two projects with overlapping source code lists. One solution might look like:

solution "MySolution"

   files { "files go here..." }
   targetname "MyLibrary"
   -- any other shared settings

project "MySharedLib"

   kind "SharedLib"

project "MyStaticLib"

   kind "StaticLib"

Premake is designed to make projects portable across toolsets; it will never be as flexible as raw Makefiles. Most IDEs are unable to (easily) produce multiple outputs from a single configuration.