I have a work directory which holds a client project called 'Client', a library project called 'MainLib', under which there is a 'vendor' directory under which there is another project called 'SecondaryLib'.
For 'Client' premake5.lua I have this configuration:
project "Client"
kind "ConsoleApp"
language "C++"
cppdialect "C++20"
staticruntime "off"
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/obj/" .. outputdir .. "/%{prj.name}")
files
{
"src/**.h",
"src/**.cpp"
}
includedirs
{
"%{wks.location}/MainLib/src",
"%{wks.location}/MainLib/vendor",
}
links
{
"MainLib"
}
filter "system:windows"
systemversion "latest"
filter "configurations:Debug"
defines "KN_DEBUG"
runtime "Debug"
symbols "on"
filter "configurations:Release"
defines "KN_RELEASE"
runtime "Release"
optimize "on"
filter "configurations:Dist"
defines "KN_DIST"
runtime "Release"
optimize "on"
For the MainLib premake5.lua:
project "MainLib"
kind "StaticLib"
language "C++"
cppdialect "C++20"
staticruntime "off"
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/obj/" .. outputdir .. "/%{prj.name}")
files
{
"src/**.h",
"src/**.cpp"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
includedirs
{
"src",
"vendor/SecondaryLib/src/include",
}
links
{
"SecondaryLib"
}
filter "system:windows"
systemversion "latest"
defines
{
"KN_PLATFORM_WINDOWS",
}
filter "configurations:Debug"
defines "KN_DEBUG"
runtime "Debug"
symbols "on"
filter "configurations:Release"
defines "KN_RELEASE"
runtime "Release"
optimize "on"
filter "configurations:Dist"
defines "KN_DIST"
runtime "Release"
optimize "on"
And for the SecondaryLib:
project "SecondaryLib"
kind "StaticLib"
language "C"
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
objdir ("obj/" .. outputdir .. "/%{prj.name}")
files
{
"include/inc.h",
"src/test.h"
}
filter "system:windows"
systemversion "latest"
staticruntime "On"
files
{
"src/test.h"
}
defines
{
"_GLFW_WIN32",
"_CRT_SECURE_NO_WARNINGS"
}
filter "configurations:Debug"
runtime "Debug"
symbols "on"
filter "configurations:Release"
runtime "Release"
optimize "on"
I can compile the 'MainLib' separately just fine, but when I try to compile the 'Client', it will output an error: *C1083 Cannot open include file: 'inc.h': No such file or directory Client E:\VS Projects\Solution\MainLib\src\MainLib.h *
inc.h being a file in the '/MainLib/vendor/SecondaryLib/src/include'-folder.
Now I could solve this by adding the same includedirs to 'Client' as 'MainLib', but I think that should not be required for a client application. I literally have another premake project with what seems to be identical settings, and it works exactly as I want.
What am I missing?
The settings were copied from a premake5 workspace where this was working.