diff --git a/.gitmodules b/.gitmodules index 54db1cb..920c27c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "bakara/vendor/spdloglib"] path = bakara/vendor/spdloglib url = https://github.com/gabime/spdlog +[submodule "bakara/vendor/glfw"] + path = bakara/vendor/glfw + url = https://github.com/glfw/glfw diff --git a/bakara/premake5.lua b/bakara/premake5.lua index 5f32637..9f3f6d4 100644 --- a/bakara/premake5.lua +++ b/bakara/premake5.lua @@ -7,6 +7,12 @@ project "bakara" targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + defines + { + "_CRT_SECURE_NO_WARNINGS", + "GLFW_INCLUDE_NONE" + } + files { "src/**.h", @@ -17,41 +23,43 @@ project "bakara" { "%{IncludeDirs.bakara}", "%{IncludeDirs.glm}", - "%{IncludeDirs.spdlog}" + "%{IncludeDirs.spdlog}", + "%{IncludeDirs.glfw}" } links { - "glm" + "glm", + "glfw" } -filter "configurations:Debug" - defines - { - "BK_DEBUG", - "DEBUG" - } - runtime "Debug" - symbols "on" + filter "configurations:Debug" + defines + { + "BK_DEBUG", + "DEBUG" + } + runtime "Debug" + symbols "on" -filter "configurations:Release" - defines - { - "BK_RELEASE", - "NDEBUG" - } - runtime "Release" - optimize "on" + filter "configurations:Release" + defines + { + "BK_RELEASE", + "NDEBUG" + } + runtime "Release" + optimize "on" -filter "system:windows" - defines - { - "BK_PLATFORM_WINDOWS" - } + filter "system:windows" + defines + { + "BK_PLATFORM_WINDOWS" + } -filter "system:linux" - defines - { - "BK_PLATFORM_LINUX" - } \ No newline at end of file + filter "system:linux" + defines + { + "BK_PLATFORM_LINUX" + } \ No newline at end of file diff --git a/bakara/vendor/glfw b/bakara/vendor/glfw new file mode 160000 index 0000000..8e6c8d7 --- /dev/null +++ b/bakara/vendor/glfw @@ -0,0 +1 @@ +Subproject commit 8e6c8d7effc54f8aecd30eda17069588298f4ada diff --git a/bakara/vendor/premake5.lua b/bakara/vendor/premake5.lua index a65ab0e..b2f966b 100644 --- a/bakara/vendor/premake5.lua +++ b/bakara/vendor/premake5.lua @@ -19,3 +19,88 @@ project "glm" { "%{IncludeDirs.glm}" } + + filter "configurations:Debug" + runtime "Debug" + symbols "on" + + filter "configurations:Release" + runtime "Release" + optimize "on" + +project "glfw" + location "./glfw" + kind "StaticLib" + language "C" + + targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}") + objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}") + + files + { + "%{prj.location}/include/GLFW/glfw3.h", + "%{prj.location}/include/GLFW/glfw3native.h", + "%{prj.location}/src/glfw_config.h", + "%{prj.location}/src/context.c", + "%{prj.location}/src/init.c", + "%{prj.location}/src/input.c", + "%{prj.location}/src/monitor.c", + "%{prj.location}/src/vulkan.c", + "%{prj.location}/src/window.c" + } + + filter "system:linux" + pic "On" + + systemversion "latest" + staticruntime "On" + + files + { + "%{prj.location}/src/x11_init.c", + "%{prj.location}/src/x11_monitor.c", + "%{prj.location}/src/x11_window.c", + "%{prj.location}/src/xkb_unicode.c", + "%{prj.location}/src/posix_time.c", + "%{prj.location}/src/posix_thread.c", + "%{prj.location}/src/glx_context.c", + "%{prj.location}/src/egl_context.c", + "%{prj.location}/src/osmesa_context.c", + "%{prj.location}/src/linux_joystick.c" + } + + defines + { + "_GLFW_X11" + } + + filter "system:windows" + systemversion "latest" + staticruntime "On" + + files + { + "%{prj.location}/src/win32_init.c", + "%{prj.location}/src/win32_joystick.c", + "%{prj.location}/src/win32_monitor.c", + "%{prj.location}/src/win32_time.c", + "%{prj.location}/src/win32_thread.c", + "%{prj.location}/src/win32_window.c", + "%{prj.location}/src/wgl_context.c", + "%{prj.location}/src/egl_context.c", + "%{prj.location}/src/osmesa_context.c" + } + + defines + { + "_GLFW_WIN32", + "_CRT_SECURE_NO_WARNINGS" + } + + filter "configurations:Debug" + runtime "Debug" + symbols "on" + + filter "configurations:Release" + runtime "Release" + optimize "on" \ No newline at end of file diff --git a/premake5.lua b/premake5.lua index e45a3ed..4ba1fb2 100644 --- a/premake5.lua +++ b/premake5.lua @@ -15,6 +15,7 @@ IncludeDirs["bakara"] = "%{wks.location}/bakara/src" IncludeDirs["vendor"] = "%{wks.location}/bakara/vendor" IncludeDirs["spdlog"] = "%{wks.location}/bakara/vendor/spdloglib/include" IncludeDirs["glm"] = "%{wks.location}/bakara/vendor/glm" +IncludeDirs["glfw"] = "%{wks.location}/bakara/vendor/glfw" group "Dependencies" include "bakara/vendor"