glfw linux build support (#150)

This commit is contained in:
Kingstom 2023-08-29 23:25:59 +08:00 committed by GitHub
parent 2e025beb91
commit a609ce90a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 6 deletions

View file

@ -37,7 +37,7 @@
// Define this to 1 if building GLFW for X11
/* #undef _GLFW_X11 */
// Define this to 1 if building GLFW for Win32
#define _GLFW_WIN32
// #define _GLFW_WIN32
// Define this to 1 if building GLFW for Cocoa
/* #undef _GLFW_COCOA */
// Define this to 1 if building GLFW for Wayland

View file

@ -27,8 +27,27 @@ target("glfw")
add_syslinks("Shell32.lib",
"Gdi32.lib")
add_defines("_GLFW_WIN32")
else
print("glfw TODO")
add_files("src/context.c",
"src/egl_context.c",
"src/init.c",
"src/input.c",
"src/monitor.c",
"src/osmesa_context.c",
"src/vulkan.c",
"src/glx_context.c",
"src/x11_init.c",
"src/linux_joystick.c",
"src/x11_monitor.c",
"src/xkb_unicode.c",
"src/posix_thread.c",
"src/posix_time.c",
"src/x11_window.c",
"src/window.c")
-- TODO: add wayland support
add_syslinks("X11", "Xrandr", "dl", "pthread")
add_defines("_GLFW_X11")
end
-- add_filegroups("include", {rootdir = "./", files = {"src/*.h"}})
-- add_filegroups("include", {rootdir = "./", files = {"src/*.h"}})

View file

@ -27,7 +27,7 @@ else
end
-- includes("3rdParty/glfw")
includes("3rdParty/glfw")
-- includes("3rdParty/rtaudio")
-- includes("3rdParty/zydis")
-- includes("3rdParty/tinydbr")
@ -51,7 +51,7 @@ target("GPCS4")
"-Wno-nonportable-include-path")
if is_mode("release") then
add_cxxflags("-flto=thin")
-- add_cxxflags("-flto=thin")
end
-- C/C++ Defines
@ -109,9 +109,10 @@ target("GPCS4")
"user32.lib")
else
print("gpcs4 TODO")
add_syslinks("vulkan")
end
-- add_deps("glfw")
add_deps("glfw")
-- add_deps("rtaudio")
-- add_deps("zydis")
-- add_deps("tinydbr")