clipboard_lite: add package (#2735)
* clipboard_lite: add package * port * disable linuxpull/2737/head
parent
b019ae232e
commit
b5b391d41a
1 changed files with 59 additions and 0 deletions
@ -0,0 +1,59 @@ |
||||
package("clipboard_lite") |
||||
set_homepage("https://github.com/smasherprog/clipboard_lite") |
||||
set_description("cross platform clipboard library") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/smasherprog/clipboard_lite.git") |
||||
add_versions("2023.10.16", "ffff8f452af0c3587e9789ec40692d519c6170f0") |
||||
|
||||
if is_plat("windows", "mingw") then |
||||
add_syslinks("user32", "gdi32", "shlwapi") |
||||
elseif is_plat("linux") then |
||||
add_deps("libx11") |
||||
add_syslinks("pthread") |
||||
elseif is_plat("macosx") then |
||||
add_frameworks("CoreFoundation", "Cocoa") |
||||
end |
||||
|
||||
on_install("windows", "macosx", "mingw", function (package) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
if is_plat("linux") then |
||||
add_requires("libx11") |
||||
end |
||||
set_languages("c++14") |
||||
target("clipboard_lite") |
||||
set_kind("$(kind)") |
||||
if is_plat("windows") and is_kind("shared") then |
||||
add_rules("utils.symbols.export_all", {export_classes = true}) |
||||
end |
||||
|
||||
add_files("src/*.cpp") |
||||
add_includedirs("include") |
||||
add_headerfiles("include/Clipboard_Lite.h") |
||||
if is_plat("windows", "mingw") then |
||||
add_files("src/windows/*.cpp") |
||||
add_includedirs("include/windows") |
||||
add_syslinks("user32", "gdi32", "shlwapi") |
||||
elseif is_plat("linux") then |
||||
add_files("src/linux/*.cpp") |
||||
add_includedirs("include/linux") |
||||
add_syslinks("pthread") |
||||
add_packages("libx11") |
||||
elseif is_plat("macosx") then |
||||
add_files("src/ios/*.mm") |
||||
add_includedirs("include/ios") |
||||
add_frameworks("CoreFoundation", "Cocoa") |
||||
end |
||||
]]) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include <Clipboard_Lite.h> |
||||
void test() { |
||||
auto clipboard = SL::Clipboard_Lite::CreateClipboard(); |
||||
} |
||||
]]}, {configs = {languages = "c++14"}})) |
||||
end) |
Loading…
Reference in new issue