diff --git a/packages/e/embree/xmake.lua b/packages/e/embree/xmake.lua new file mode 100644 index 000000000..da71c477f --- /dev/null +++ b/packages/e/embree/xmake.lua @@ -0,0 +1,29 @@ +package("embree") + + set_homepage("https://www.embree.org/") + set_description("IntelĀ® Embree is a collection of high-performance ray tracing kernels, developed at Intel.") + set_license("Apache-2.0") + + add_urls("https://github.com/embree/embree/archive/v$(version).tar.gz") + add_versions("3.12.1", "0c9e760b06e178197dd29c9a54f08ff7b184b0487b5ba8b8be058e219e23336e") + + add_deps("cmake", "tbb") + + on_install("macosx", "linux", "windows", function (package) + local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOC=OFF", "-DEMBREE_TUTORIALS=OFF", "-DEMBREE_ISPC_SUPPORT=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + if package:is_plat("windows") then + table.insert(configs, "-DUSE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + void test() { + RTCDevice device = rtcNewDevice(NULL); + assert(device != NULL); + } + ]]}, {configs = {languages = "c++11"}, includes = "embree3/rtcore.h"})) + end) diff --git a/packages/f/fmt/xmake.lua b/packages/f/fmt/xmake.lua index eff4a8c5a..3d7e96a16 100644 --- a/packages/f/fmt/xmake.lua +++ b/packages/f/fmt/xmake.lua @@ -9,14 +9,12 @@ package("fmt") add_versions("6.0.0", "b4a16b38fa171f15dbfb958b02da9bbef2c482debadf64ac81ec61b5ac422440") add_versions("5.3.0", "4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c") - add_configs("header_only", {description = "Use header only", default = true, type = "boolean"}) - add_configs("cmake", {description = "Use cmake buildsystem", default = false, type = "boolean"}) + add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"}) on_load(function (package) if package:config("header_only") then package:add("defines", "FMT_HEADER_ONLY=1") - end - if not package:config("header_only") or package:config("cmake") then + else package:add("deps", "cmake") end if package:config("shared") then @@ -25,17 +23,17 @@ package("fmt") end) on_install(function (package) - if package:config("header_only") and not package:config("cmake") then + if package:config("header_only") then os.cp("include/fmt", package:installdir("include")) return end - - local configs = {} + io.gsub("CMakeLists.txt", "MASTER_PROJECT AND CMAKE_GENERATOR MATCHES \"Visual Studio\"", "0") + local configs = {"-DFMT_TEST=OFF", "-DFMT_DOC=OFF", "-DFMT_FUZZ=OFF"} + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded" .. (package:debug() and "Debug" or "") .. (package:config("vs_runtime"):startswith("MT") and "" or "DLL")) + end table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) - table.insert(configs, "-DFMT_TEST=OFF") - table.insert(configs, "-DFMT_DOC=OFF") - table.insert(configs, "-DFMT_FUZZ=OFF") import("package.tools.cmake").install(package, configs) end) @@ -48,6 +46,6 @@ package("fmt") std::string s = fmt::format("{}", "hello"); assert(s == "hello"); } - ]]}, {configs = {languages = "c++11"}, includes = "fmt/format.h", defines="FMT_HEADER_ONLY"})) + ]]}, {configs = {languages = "c++11"}, includes = "fmt/format.h"})) end) diff --git a/packages/m/metis/xmake.lua b/packages/m/metis/xmake.lua new file mode 100644 index 000000000..e03f2510e --- /dev/null +++ b/packages/m/metis/xmake.lua @@ -0,0 +1,28 @@ +package("metis") + + set_homepage("http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") + set_description("Serial Graph Partitioning and Fill-reducing Matrix Ordering") + + add_urls("https://github.com/xq114/METIS/archive/v$(version).tar.gz") + add_versions("5.1.1", "945d381d3b50ca70ac93f0daf32c80e6f16f11514879d5ff1438aa82c20a0ba5") + + add_deps("cmake") + add_configs("long_index", {description = "Use 64-bit uint as index.", default = false, type = "boolean"}) + add_configs("double", {description = "Use double precision floats.", default = true, type = "boolean"}) + + on_install("windows", "macosx", "linux", function (package) + if package:config("long_index") then + io.gsub(path.join("include", "metis.h"), "define IDXTYPEWIDTH %d+", "define IDXTYPEWIDTH 64") + end + if package:config("double") then + io.gsub(path.join("include", "metis.h"), "define REALTYPEWIDTH %d+", "define REALTYPEWIDTH 64") + end + local configs = {} + table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DDEBUG=" .. (package:debug() and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cxxfuncs("METIS_SetDefaultOptions", {includes = "metis.h"})) + end) diff --git a/packages/s/spdlog/xmake.lua b/packages/s/spdlog/xmake.lua index fccabde55..b3faf658f 100644 --- a/packages/s/spdlog/xmake.lua +++ b/packages/s/spdlog/xmake.lua @@ -5,7 +5,7 @@ package("spdlog") set_urls("https://github.com/gabime/spdlog/archive/v$(version).zip", "https://github.com/gabime/spdlog.git") - + add_versions("1.8.1", "eed0095a1d52d08a0834feda146d4f9148fa4125620cd04d8ea57e0238fa39cd") add_versions("1.8.0", "3cc41508fcd79e5141a6ef350506ef82982ca42a875e0588c02c19350ac3702e") add_versions("1.5.0", "87e87c989f15d6b9f5379385aec1001c89a42941341ebaa09ec895b98a00efb4") add_versions("1.4.2", "56b90f0bd5b126cf1b623eeb19bf4369516fa68f036bbc22d9729d2da511fb5a") @@ -26,7 +26,7 @@ package("spdlog") package:add("deps", "cmake") end if package:config("fmt_external") then - package:add("deps", "fmt") + package:add("deps", "fmt", {configs = {header_only = true}}) end end)