Modified premake config to fix glfw linking errors

dev
anulax1225 ago%!(EXTRA string=1 year)
parent 4ba7c2efef
commit 471f4db939
  1. 27
      bakara/premake5.lua
  2. 31
      bakara/vendor/premake5.lua
  3. 1
      premake5.lua
  4. 8
      sandbox/premake5.lua

@ -1,5 +1,5 @@
project "bakara" project "bakara"
kind "StaticLib" kind "SharedLib"
language "C++" language "C++"
cppdialect "C++17" cppdialect "C++17"
staticruntime "off" staticruntime "off"
@ -7,37 +7,34 @@ project "bakara"
targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
defines files
{ {
"_CRT_SECURE_NO_WARNINGS", "src/**.h",
"GLFW_INCLUDE_NONE" "src/**.cpp"
} }
buildoptions buildoptions
{ {
"-lglfw", "-Wall"
"-lGL"
} }
files defines
{ {
"src/**.h", "GLFW_INCLUDE_NONE"
"src/**.cpp"
} }
includedirs includedirs
{ {
"%{IncludeDirs.bakara}", "%{IncludeDirs.bakara}",
"%{IncludeDirs.glfw}",
"%{IncludeDirs.glm}", "%{IncludeDirs.glm}",
"%{IncludeDirs.spdlog}" "%{IncludeDirs.spdlog}",
"%{IncludeDirs.glfw}"
} }
links links
{ {
"GLFW",
"opengl32.lib",
"glm", "glm",
"GLFW"
} }
filter "configurations:Debug" filter "configurations:Debug"

@ -10,27 +10,31 @@ project "GLFW"
files files
{ {
"%{prj.location}/src/glfw_config.h", "%{prj.location}/src/internal.h",
"%{prj.location}/include/GLFW/glfw3native.h", "%{prj.location}/src/platform.h",
"%{prj.location}/include/GLFW/glfw3.h", "%{prj.location}/src/mappings.h",
"%{prj.location}/src/context.c", "%{prj.location}/src/context.c",
"%{prj.location}/src/init.c", "%{prj.location}/src/init.c",
"%{prj.location}/src/input.c", "%{prj.location}/src/input.c",
"%{prj.location}/src/monitor.c", "%{prj.location}/src/monitor.c",
"%{prj.location}/src/vulkan.c",
"%{prj.location}/src/window.c", "%{prj.location}/src/window.c",
"%{prj.location}/src/platform.c", "%{prj.location}/src/platform.c",
"%{prj.location}/src/vulkan.c",
"%{prj.location}/src/null_init.c", "%{prj.location}/src/null_init.c",
"%{prj.location}/src/null_monitor.c", "%{prj.location}/src/null_monitor.c",
"%{prj.location}/src/null_window.c", "%{prj.location}/src/null_window.c",
"%{prj.location}/src/null_joystick.c", "%{prj.location}/src/null_joystick.c",
"%{prj.location}/src/glfw_config.h",
"%{prj.location}/include/GLFW/glfw3native.h",
"%{prj.location}/include/GLFW/glfw3.h",
"include/GLFW/glfw3.h",
"include/GLFW/glfw3native.h",
} }
filter "system:linux" filter "system:linux"
pic "On" pic "On"
systemversion "latest" systemversion "latest"
staticruntime "On"
files files
{ {
@ -39,6 +43,8 @@ project "GLFW"
"%{prj.location}/src/x11_window.c", "%{prj.location}/src/x11_window.c",
"%{prj.location}/src/xkb_unicode.c", "%{prj.location}/src/xkb_unicode.c",
"%{prj.location}/src/posix_time.c", "%{prj.location}/src/posix_time.c",
"%{prj.location}/src/posix_module.c",
"%{prj.location}/src/posix_poll.c",
"%{prj.location}/src/posix_thread.c", "%{prj.location}/src/posix_thread.c",
"%{prj.location}/src/glx_context.c", "%{prj.location}/src/glx_context.c",
"%{prj.location}/src/egl_context.c", "%{prj.location}/src/egl_context.c",
@ -46,6 +52,21 @@ project "GLFW"
"%{prj.location}/src/linux_joystick.c" "%{prj.location}/src/linux_joystick.c"
} }
links
{
"GL",
"GLU",
"glut",
"Xxf86vm",
"Xinerama",
"Xi",
"dl",
"X11",
"Xrandr",
"Xcursor",
"pthread"
}
defines defines
{ {
"_GLFW_X11" "_GLFW_X11"

@ -18,6 +18,7 @@ IncludeDirs["vendor"] = "%{wks.location}/bakara/vendor"
IncludeDirs["spdlog"] = "%{wks.location}/bakara/vendor/spdloglib/include" IncludeDirs["spdlog"] = "%{wks.location}/bakara/vendor/spdloglib/include"
IncludeDirs["glm"] = "%{wks.location}/bakara/vendor/glm" IncludeDirs["glm"] = "%{wks.location}/bakara/vendor/glm"
IncludeDirs["glfw"] = "%{wks.location}/bakara/vendor/glfw/include" IncludeDirs["glfw"] = "%{wks.location}/bakara/vendor/glfw/include"
IncludeDirs["sdl2"] = "%{wks.location}/bakara/vendor/SDL/include"
group "Dependencies" group "Dependencies"
include "bakara/vendor" include "bakara/vendor"

@ -13,17 +13,21 @@ project "sandbox"
"src/**.cpp" "src/**.cpp"
} }
buildoptions
{
"-Wall"
}
includedirs includedirs
{ {
"%{IncludeDirs.bakara}", "%{IncludeDirs.bakara}",
"%{IncludeDirs.spdlog}", "%{IncludeDirs.spdlog}",
"%{IncludeDirs.glm}", "%{IncludeDirs.glm}",
""
} }
links links
{ {
"bakara" "bakara",
} }

Loading…
Cancel
Save