parent
51254c7a54
commit
c9fbda5e15
6 changed files with 82 additions and 0 deletions
@ -0,0 +1,26 @@ |
||||
package("ceval") |
||||
|
||||
set_kind("library", {headeronly = true}) |
||||
set_homepage("https://github.com/erstan/ceval") |
||||
set_description("A C/C++ library for parsing and evaluation of arithmetic expressions.") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/erstan/ceval/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/erstan/ceval.git") |
||||
add_versions("1.0.0", "3bb8cca8f0f7bf6f5ee6e7198d1174eab4d493318b6d97cc739343017090573e") |
||||
|
||||
on_install(function (package) |
||||
io.replace("core/parser.h", "malloc.h", "stdlib.h", {plain = true}) |
||||
os.mkdir(path.join(package:installdir("include"), "ceval")) |
||||
os.cp("ceval.h", path.join(package:installdir("include"), "ceval", "ceval.h")) |
||||
os.cp("core", path.join(package:installdir("include"), "ceval")) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_csnippets({test = [[ |
||||
void test() { |
||||
ceval_tree("1+1"); |
||||
ceval_result("1+1"); |
||||
} |
||||
]]}, {includes = "ceval/ceval.h"})) |
||||
end) |
@ -0,0 +1,14 @@ |
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -79,7 +79,10 @@
|
||||
else (BUILD_DROGON_SHARED)
|
||||
add_library(${PROJECT_NAME} STATIC)
|
||||
endif (BUILD_DROGON_SHARED)
|
||||
|
||||
+if (APPLE)
|
||||
+ target_link_libraries(${PROJECT_NAME} PUBLIC resolv)
|
||||
+endif (APPLE)
|
||||
if (NOT ${CMAKE_PLATFORM_NAME} STREQUAL "Windows" AND CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
|
||||
endif ()
|
@ -0,0 +1,15 @@ |
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -120,9 +120,9 @@
|
||||
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/mman-win32>)
|
||||
endif (WIN32)
|
||||
|
||||
-add_subdirectory(trantor)
|
||||
+find_package(Trantor CONFIG REQUIRED)
|
||||
|
||||
-target_link_libraries(${PROJECT_NAME} PUBLIC trantor)
|
||||
+target_link_libraries(${PROJECT_NAME} PUBLIC Trantor::Trantor)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku")
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE network)
|
@ -0,0 +1,23 @@ |
||||
package("prvhash") |
||||
|
||||
set_kind("library", {headeronly = true}) |
||||
set_homepage("https://github.com/avaneev/prvhash") |
||||
set_description("PRVHASH - Pseudo-Random-Value Hash") |
||||
set_license("MIT") |
||||
|
||||
add_urls("https://github.com/avaneev/prvhash/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/avaneev/prvhash.git") |
||||
add_versions("4.0", "b4d8ce80ee73e504faccd235d4071398c95b06421095eeb2502ef46a810f8375") |
||||
|
||||
on_install(function (package) |
||||
os.cp("*.h", package:installdir("include")) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_csnippets({test = [[ |
||||
void test() { |
||||
uint64_t Seed = 0, lcg = 0, Hash = 0; |
||||
uint64_t v = prvhash_core64(&Seed, &lcg, &Hash); |
||||
} |
||||
]]}, {includes = "prvhash_core.h"})) |
||||
end) |
Loading…
Reference in new issue