-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'xmake-io:dev' into dev
- Loading branch information
Showing
28 changed files
with
430 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
add_rules("mode.release", "mode.debug") | ||
|
||
target("blake3") | ||
set_kind("$(kind)") | ||
add_files("c/blake3.c", "c/blake3_dispatch.c", "c/blake3_portable.c") | ||
add_headerfiles("c/blake3.h") | ||
|
||
if is_arch("x86_64", "x64") then | ||
if is_subhost("msys", "cygwin") then | ||
add_files("c/*x86-64_windows_gnu.S") | ||
elseif is_plat("windows") then | ||
add_files("c/*x86-64_windows_msvc.asm") | ||
else | ||
add_files("c/*x86-64_unix.S") | ||
end | ||
elseif is_arch("x86", "i386") then | ||
add_files("c/blake3_portable.c") | ||
add_files("c/blake3_sse2.c") | ||
add_files("c/blake3_sse41.c") | ||
add_files("c/blake3_avx2.c") | ||
add_files("c/blake3_avx512.c") | ||
elseif is_arch("arm64", "arm64-v8a") then | ||
add_files("c/blake3_neon.c") | ||
add_defines("BLAKE3_USE_NEON=1") | ||
end | ||
|
||
if is_plat("windows") and is_kind("shared") then | ||
add_rules("utils.symbols.export_all") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package("cserialport") | ||
set_homepage("https://github.com/itas109/CSerialPort") | ||
set_description("CSerialPort is a lightweight cross-platform serial port library based on C++, which can easy to read and write serial port on multiple operating system.") | ||
set_license("LGPL-3.0") | ||
|
||
add_urls("https://github.com/itas109/CSerialPort/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/itas109/CSerialPort.git") | ||
|
||
add_versions("v4.3.1", "376f41866be65ddfed91f3d0fea91aaaf5ca7e645f9b9cfcdaa0a9182a0bb3ac") | ||
|
||
add_configs("c_api", {description = "Build C API", default = false, type = "boolean"}) | ||
|
||
if is_plat("windows", "mingw") then | ||
add_syslinks("advapi32") | ||
elseif is_plat("linux", "bsd") then | ||
add_syslinks("pthread") | ||
elseif is_plat("macosx") then | ||
add_frameworks("Foundation", "IOKit") | ||
end | ||
|
||
add_deps("cmake") | ||
|
||
if on_check then | ||
on_check("windows", function (package) | ||
import("core.base.semver") | ||
|
||
if package:is_arch("arm.*") then | ||
local vs_toolset = package:toolchain("msvc"):config("vs_toolset") | ||
assert(vs_toolset and semver.new(vs_toolset):minor() >= 30, "package(cserialport/arm): need vs_toolset >= v143") | ||
end | ||
end) | ||
end | ||
|
||
on_install("!cross and !iphoneos and !android", function (package) | ||
local configs = {"-DCSERIALPORT_BUILD_EXAMPLES=OFF"} | ||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_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) | ||
|
||
if package:config("c_api") then | ||
io.replace("bindings/c/cserialport.h", "#define C_DLL_EXPORT __declspec(dllexport)", "#define C_DLL_EXPORT", {plain = true}) | ||
io.writefile("xmake.lua", [[ | ||
add_rules("mode.debug", "mode.release") | ||
target("cserialport-c") | ||
set_kind("static") | ||
add_files("bindings/c/cserialport.cpp") | ||
add_headerfiles("bindings/c/cserialport.h") | ||
add_includedirs("include") | ||
]]) | ||
import("package.tools.xmake").install(package) | ||
end | ||
end) | ||
|
||
on_test(function (package) | ||
assert(package:check_cxxsnippets({test = [[ | ||
void test() { | ||
itas109::CSerialPort serialPort; | ||
} | ||
]]}, {configs = {languages = "c++11"}, includes = "CSerialPort/SerialPort.h"})) | ||
|
||
if package:config("c_api") then | ||
assert(package:has_cfuncs("CSerialPortInit", {includes = "cserialport.h"})) | ||
end | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package("hyperscan") | ||
set_homepage("https://www.hyperscan.io") | ||
set_description("High-performance regular expression matching library") | ||
set_license("BSD-3") | ||
|
||
add_urls("https://github.com/intel/hyperscan/archive/refs/tags/$(version).tar.gz", | ||
"https://github.com/intel/hyperscan.git") | ||
add_versions("v5.4.2", "32b0f24b3113bbc46b6bfaa05cf7cf45840b6b59333d078cc1f624e4c40b2b99") | ||
|
||
add_deps("cmake", "boost", "ragel", "python") | ||
|
||
on_install("linux", "windows|!arm*", function (package) | ||
local configs = {} | ||
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_cxxfuncs("hs_compile", {includes = "hs/hs.h"})) | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.