package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.4 KiB

5 years ago
package("raylib")
set_homepage("http://www.raylib.com")
set_description("A simple and easy-to-use library to enjoy videogames programming.")
if is_plat("macosx") then
add_urls("https://github.com/raysan5/raylib/releases/download/$(version).tar.gz", {version = function (version)
if version:ge("3.5.0") then
return version .. "/raylib-" .. version .. "_macos"
else
return version .. "/raylib-" .. version .. "-macOS"
end
end})
5 years ago
add_versions("2.5.0", "e9ebdf70ad4912dc9f3c7965dc702d5c61f2841aeae521e8dd3b0a96a9d82d58")
add_versions("3.0.0", "8244898b09887f29baa9325b5ae47c30ec0f45dc15b4f740178c65af068b3141")
add_versions("3.5.0", "9b9be75fe1b231225c91a6fcf5ed9c24cbf03c6193f917e40e4655ef27f281e2")
5 years ago
else
add_urls("https://github.com/raysan5/raylib/archive/$(version).tar.gz",
"https://github.com/raysan5/raylib.git")
add_versions("2.5.0", "fa947329975bdc9ea284019f0edc30ca929535dc78dcf8c19676900d67a845ac")
add_versions("3.0.0", "164d1cc1710bb8e711a495e84cc585681b30098948d67d482e11dc37d2054eab")
add_versions("3.5.0", "761985876092fa98a99cbf1fef7ca80c3ee0365fb6a107ab901a272178ba69f5")
5 years ago
end
if not is_plat("macosx") then
add_deps("cmake >=3.11")
5 years ago
end
if is_plat("macosx") then
add_frameworks("OpenGL", "CoreVideo", "CoreGraphics", "AppKit", "IOKit", "CoreFoundation", "Foundation")
elseif is_plat("windows") then
add_syslinks("gdi32", "user32", "winmm", "shell32")
elseif is_plat("linux") then
add_syslinks("pthread", "dl", "m")
add_deps("libx11", "libxrandr", "libxrender", "libxinerama", "libxcursor", "libxi", "libxext")
5 years ago
end
on_install("macosx", function (package)
os.cp("include/raylib.h", package:installdir("include"))
5 years ago
os.cp("lib/libraylib.a", package:installdir("lib"))
end)
5 years ago
on_install("windows", "linux", function (package)
import("package.tools.cmake").install(package, {"-DBUILD_EXAMPLES=OFF", "-DBUILD_GAMES=OFF"})
end)
5 years ago
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
InitWindow(100, 100, "hello world!");
Camera camera = { 0 };
UpdateCamera(&camera);
}
]]}, {includes = {"raylib.h"}}))
5 years ago
end)