improve glew to support mingw (#399)

* glew

* fix glew for mingw
pull/402/head
ruki 4 years ago committed by GitHub
parent 89ad2f9939
commit 69cafbc69d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      packages/g/glew/port/xmake.lua
  2. 4
      packages/g/glew/xmake.lua

@ -6,7 +6,7 @@ end
target("glew")
set_kind("$(kind)")
if is_plat("windows") or is_plat("mingw") then
if is_plat("windows", "mingw") then
set_basename("glew32")
add_syslinks("glu32", "opengl32")
elseif is_plat("macosx") then
@ -16,11 +16,13 @@ target("glew")
end
add_defines("GLEW_NO_GLU")
if is_plat("windows") then
if get_config("kind") == "shared" then
if is_kind("shared") then
add_defines("GLEW_BUILD")
else
add_defines("GLEW_STATIC", {public = true})
end
elseif is_plat("mingw") and not is_kind("shared") then
add_defines("GLEW_STATIC", {public = true})
end
add_files("src/glew.c")
add_includedirs("include", {public = true})
@ -29,7 +31,7 @@ target("glew")
target("glewinfo")
set_kind("binary")
add_deps("glew")
if is_plat("windows") or is_plat("mingw") then
if is_plat("windows", "mingw") then
add_syslinks("user32", "gdi32", "glu32", "opengl32")
elseif is_plat("macosx") then
add_frameworks("OpenGL")
@ -42,7 +44,7 @@ target("glewinfo")
target("visualinfo")
set_kind("binary")
add_deps("glew")
if is_plat("windows") or is_plat("mingw") then
if is_plat("windows", "mingw") then
add_syslinks("user32", "gdi32", "glu32", "opengl32")
elseif is_plat("macosx") then
add_frameworks("OpenGL")

@ -14,13 +14,13 @@ package("glew")
add_deps("libx11", "xorgproto")
end
on_load("windows", "mingw@windows", function (package)
on_load("windows", "mingw", function (package)
if not package:config("shared") then
package:add("defines", "GLEW_STATIC")
end
end)
on_install("linux", "macosx", "mingw@windows", "windows", function (package)
on_install("linux", "macosx", "mingw", "windows", function (package)
local configs = {}
configs.mode = package:debug() and "debug" or "release"
if package:config("shared") then

Loading…
Cancel
Save