improve tinyobjloader (#847)

* improve tinyobjloader

* update glfw

* remove extra indentation
pull/903/head
Hoildkv 3 years ago committed by GitHub
parent 182a69aaf3
commit 0be344042d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      packages/g/glfw/xmake.lua
  2. 14
      packages/t/tinyobjloader/xmake.lua

@ -9,6 +9,7 @@ package("glfw")
add_versions("3.3.2", "98768e12e615fbe9f3386f5bbfeb91b5a3b45a8c4c77159cef06b1f6ff749537")
add_versions("3.3.4", "cc8ac1d024a0de5fd6f68c4133af77e1918261396319c24fd697775a6bc93b63")
add_versions("3.3.5", "32fdb8705784adfe3082f97e0d41e7c515963e977b5a14c467a887cf0da827b5")
add_versions("3.3.6", "ed07b90e334dcd39903e6288d90fa1ae0cf2d2119fec516cf743a0a404527c02")
add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3"}})

@ -9,17 +9,25 @@ package("tinyobjloader")
add_versions("1.0.7", "b9d08b675ba54b9cb00ffc99eaba7616d0f7e6f6b8947a7e118474e97d942129")
add_configs("double", {description = "Use double precision floating numbers.", default = false, type = "boolean"})
if is_plat("windows") then
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
end
on_load(function (package)
if package:config("double") then
package:add("defines", "TINYOBJLOADER_USE_DOUBLE")
end
end)
on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package)
local kind = package:config("shared") and "shared" or "static"
io.writefile("xmake.lua", string.format([[
add_rules("mode.debug", "mode.release")
target("tinyobjloader")
set_kind("%s")
set_kind("$(kind)")
%s
add_files("tiny_obj_loader.cc")
add_headerfiles("tiny_obj_loader.h")
]], kind, (package:config("double") and "add_defines(\"TINYOBJLOADER_USE_DOUBLE\")" or "")))
]], package:config("double") and "add_defines(\"TINYOBJLOADER_USE_DOUBLE\")" or ""))
import("package.tools.xmake").install(package)
end)

Loading…
Cancel
Save