Update README.md

pull/799/head
ruki 3 years ago committed by GitHub
parent 00fb29b7b4
commit 97f9b40934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      README.md

@ -105,20 +105,24 @@ Create a package configuration file to this warehouse based on the package addre
```console ```console
$ xmake l scripts/new.lua github:glennrp/libpng $ xmake l scripts/new.lua github:glennrp/libpng
package("libpng") package("libpng")
set_homepage("http://libpng.sf.net") set_homepage("http://libpng.sf.net")
set_description("LIBPNG: Portable Network Graphics support, official libpng repository") set_description("LIBPNG: Portable Network Graphics support, official libpng repository")
add_urls("https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.tar.gz", add_urls("https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.tar.gz",
"https://github.com/glennrp/libpng.git") "https://github.com/glennrp/libpng.git")
add_versions("v1.6.35", "6d59d6a154ccbb772ec11772cb8f8beb0d382b61e7ccc62435bf7311c9f4b210") add_versions("v1.6.35", "6d59d6a154ccbb772ec11772cb8f8beb0d382b61e7ccc62435bf7311c9f4b210")
on_install(function (package) add_deps("cmake")
local configs = {}
import("package.tools.xmake").install(package, configs)
end)
on_test(function (package) on_install(function (package)
assert(package:has_cfuncs("foo", {includes = "foo.h"})) local configs = {}
end) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("foo", {includes = "foo.h"}))
end)
packages/l/libpng/xmake.lua generated! packages/l/libpng/xmake.lua generated!
``` ```

Loading…
Cancel
Save