From 341504fa9d1b650850107e2e508e88bf4bd6ac43 Mon Sep 17 00:00:00 2001 From: anulax1225 Date: Wed, 31 Jan 2024 18:48:13 +0100 Subject: [PATCH] Modified config to link glad as a static libreary and added fPIC flag to link glad in a shared libreary --- bakara/premake5.lua | 12 +++++++++++- bakara/vendor/premake5.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/bakara/premake5.lua b/bakara/premake5.lua index 7c31293..053a0af 100644 --- a/bakara/premake5.lua +++ b/bakara/premake5.lua @@ -5,6 +5,7 @@ project "bakara" targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + files { "vendor/glm/glm/**.hpp", @@ -13,17 +14,25 @@ project "bakara" "src/**.cpp", } + defines + { + "_CRT_SECURE_NO_WARNINGS", + "GLFW_INCLUDE_NONE" + } + includedirs { "%{IncludeDirs.bakara}", "%{IncludeDirs.glm}", "%{IncludeDirs.spdlog}", + "%{IncludeDirs.glad}", "%{IncludeDirs.glfw}" } links { - "GLFW" + "GLFW", + "GLAD" } filter "configurations:Debug" @@ -61,6 +70,7 @@ project "bakara" filter "system:linux" kind "SharedLib" staticruntime "off" + files { "vendor/glm/glm/**.cpp" diff --git a/bakara/vendor/premake5.lua b/bakara/vendor/premake5.lua index e1819c2..4342b58 100644 --- a/bakara/vendor/premake5.lua +++ b/bakara/vendor/premake5.lua @@ -89,3 +89,30 @@ project "GLFW" runtime "Release" optimize "on" +project "GLAD" + location "./glad" + kind "StaticLib" + language "C" + systemversion "latest" + + targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") + objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + + includedirs { "%{prj.location}/include" } + + buildoptions { "-fPIC" } + + files + { + "%{prj.location}/src/glad.c", + "%{prj.location}/include/KHR/khrplatform.h", + "%{prj.location}/include/glad.h" + } + + filter "configurations:Debug" + runtime "Debug" + symbols "on" + + filter "configurations:Release" + runtime "Release" + optimize "on" \ No newline at end of file