Closed star-hengxing closed 10 months ago
Add some helpful interface.
Before:
on_install(function (package) local configs = {} 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) end) on_test(function (package) local cxflags if package:is_plat("windows") then cxflags = {"/Zc:__cplusplus", "/permissive-"} else cxflags = "-fPIC" end assert(package:check_cxxsnippets({test = [[ #include <QtAwesome/QtAwesome.h> void test() { fa::QtAwesome* awesome = new fa::QtAwesome(nullptr); awesome->initFontAwesome(); } ]]}, {configs = {languages = "c++17", cxflags = cxflags}})) end)
Now:
on_install(function (package) local configs = { "CMAKE_BUILD_TYPE" = (package:is_debug() and "Debug" or "Release"), "BUILD_SHARED_LIBS" = package:config("shared") } configs = import("package.tools.cmake").genconfig(configs) import("package.tools.cmake").install(package, configs) end) on_test(function (package) assert(package:check_qt_snippets({test = [[ #include <QtAwesome/QtAwesome.h> void test() { fa::QtAwesome* awesome = new fa::QtAwesome(nullptr); awesome->initFontAwesome(); } ]]})) end)
No response
on_install 没感觉简化了,反而更复杂了,之前4行,现在6行,还要 import 两次 cmake
on_test 部分不考虑。。package 这种不会去加 qt 特有的接口package:check_qt_snippets。。都是通用接口。
Is your feature request related to a problem? Please describe.
Add some helpful interface.
Describe the solution you'd like
Before:
Now:
Describe alternatives you've considered
No response
Additional context
No response