'premake doesn't include static libraries
I'm using premake5 and SFML (a graphics library).
I want to make a static library so that the user only has to link against it and not its dependencies.
premake5.lua:
workspace "Processing"
architecture "x64"
startproject "ProcessingLibStatic"
configurations {
"Debug",
"Release"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
project "ProcessingLibStatic"
kind "StaticLib"
language "C++"
cppdialect "C++latest"
staticruntime "on"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("build/" .. outputdir .. "/%{prj.name}")
-- pchheader ""
-- pchsource ""
files {
"src/**"
}
defines {
"SFML_STATIC"
}
includedirs {
"src",
"include"
}
libdirs {
"libs/SFML"
}
links {
"sfml-graphics-s",
"sfml-window-s",
"sfml-audio-s",
"sfml-network-s",
"sfml-system-s",
"sfml-main",
"FLAC",
"freetype",
"openal32",
"opengl32",
"vorbisfile",
"vorbisenc",
"vorbis",
"ogg",
"winmm",
"ws2_32",
"gdi32"
}
filter "configurations:Release"
runtime "Release"
optimize "on"
filter "configurations:Debug"
runtime "Debug"
defines "PROCESSING_DEBUG"
symbols "on"
As you can see in the links-list, there are a lot of other libraries that should not show up in the premake file of the executable but, when I leave them out, I get an undefined-reference-error while linking.
How can I include the dependencies into my static library?
Maybe I can use the --whole-archive flag?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
