When creating a shared library (MathLib.dll) on Windows using premake4, and running the generated makefile, in fact 2 targets are created: MathLib.dll (25 KB) and a file (libMath.a of 2 KB size). The libMath.a file seems to be a dummy (empty) static library, since it is only of 2K size. Also it isn’t cleaned up when executing premake clean.
What's happening is that when I create a shared library using premake4, it creates it alright, but it also creates a dummy static library! In fact, this is more serious than it sounds, because if there had been a (genuine) static library of that name in the directory containing the libraries, then when I run premake to create a shared library, the new (dummy/empty) static library erroneously created by premake, OVERWRITES AND REPLACES the genuine static library of the same name that was already existing in the dir.
A workaround may be to avoid creating the libraries in a common dir initially, but instead create in a separate (local) dir, perhaps the same as the one containing the (shared library creation) source files and then copy the (genuine) library to the final common library dir.
Is there any way to prevent creation of this spurious static library?
-- Register the "runmakefile" action.
newaction
{
trigger = "runmakefile",
description = "run the generated makefile to create the executable using the default (debug config)",
execute = function()
os.execute("make")
end
}
-- Register the "runmakefilerelease" action.
newaction
{
trigger = "runmakefilerelease",
description = "run the generated makefile to create the executable using the 'release' config)",
execute = function()
os.execute("make config=release")
end
}`
When creating a shared library (MathLib.dll) on Windows using premake4, and running the generated makefile, in fact 2 targets are created: MathLib.dll (25 KB) and a file (libMath.a of 2 KB size). The libMath.a file seems to be a dummy (empty) static library, since it is only of 2K size. Also it isn’t cleaned up when executing premake clean.
What's happening is that when I create a shared library using premake4, it creates it alright, but it also creates a dummy static library! In fact, this is more serious than it sounds, because if there had been a (genuine) static library of that name in the directory containing the libraries, then when I run premake to create a shared library, the new (dummy/empty) static library erroneously created by premake, OVERWRITES AND REPLACES the genuine static library of the same name that was already existing in the dir.
A workaround may be to avoid creating the libraries in a common dir initially, but instead create in a separate (local) dir, perhaps the same as the one containing the (shared library creation) source files and then copy the (genuine) library to the final common library dir.
Is there any way to prevent creation of this spurious static library?
The premake file contains:
`solution "MathLib" configurations { "Debug", "Release" }
-- A project defines one build target project "MathLib" kind "SharedLib" language "C++" files { ".h", ".cpp" } -- Create target library in Files > C > SW > -- Applications > ProgramLibraries targetdir "../../../ProgramLibraries/"
-- Register the "runmakefile" action. newaction { trigger = "runmakefile", description = "run the generated makefile to create the executable using the default (debug config)", execute = function() os.execute("make") end }
-- Register the "runmakefilerelease" action. newaction { trigger = "runmakefilerelease", description = "run the generated makefile to create the executable using the 'release' config)", execute = function() os.execute("make config=release") end }`