浏览代码

Add system include option for GLFW (#3585)

Aidan Sun 1 年之前
父节点
当前提交
5ebbe04b09
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      packages/g/glfw/xmake.lua

+ 5 - 2
packages/g/glfw/xmake.lua

@@ -15,7 +15,7 @@ package("glfw")
     add_versions("3.3.9", "a7e7faef424fcb5f83d8faecf9d697a338da7f7a906fc1afbc0e1879ef31bd53")
     add_versions("3.3.9", "a7e7faef424fcb5f83d8faecf9d697a338da7f7a906fc1afbc0e1879ef31bd53")
     add_versions("3.4", "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01")
     add_versions("3.4", "c038d34200234d071fae9345bc455e4a8f2f544ab60150765d7704e08f3dac01")
 
 
-    add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3"}})
+    add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3", "system"}})
     add_configs("x11", {description = "Build support for X11", default = is_plat("linux"), type = "boolean"})
     add_configs("x11", {description = "Build support for X11", default = is_plat("linux"), type = "boolean"})
     add_configs("wayland", {description = "Build support for Wayland", default = false, type = "boolean"})
     add_configs("wayland", {description = "Build support for Wayland", default = false, type = "boolean"})
 
 
@@ -36,7 +36,10 @@ package("glfw")
     end
     end
 
 
     on_load(function (package)
     on_load(function (package)
-        package:add("defines", "GLFW_INCLUDE_" .. package:config("glfw_include"):upper())
+        local glfw_include = package:config("glfw_include")
+        if glfw_include ~= "system" then
+            package:add("defines", "GLFW_INCLUDE_" .. glfw_include:upper())
+        end
         if package:config("x11") then
         if package:config("x11") then
             package:add("deps", "libx11", "libxrandr", "libxrender", "libxinerama", "libxfixes", "libxcursor", "libxi", "libxext")
             package:add("deps", "libx11", "libxrandr", "libxrender", "libxinerama", "libxfixes", "libxcursor", "libxi", "libxext")
         end
         end