From 6b470dffa2e479055d5983511dd6338542b659ea Mon Sep 17 00:00:00 2001 From: Chi Huu Huynh <73843190+Chi-EEE@users.noreply.github.com> Date: Thu, 15 Aug 2024 02:31:21 +0100 Subject: [PATCH] yaml-cpp: remove limits (#4926) * Update xmake.lua * yaml-cpp: update test * yaml-cpp: exclude mingw * yaml-cpp: make shared if mingw * fix mingw static --------- Co-authored-by: star9029 --- packages/y/yaml-cpp/xmake.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/y/yaml-cpp/xmake.lua b/packages/y/yaml-cpp/xmake.lua index ab7a89815..fccb20154 100644 --- a/packages/y/yaml-cpp/xmake.lua +++ b/packages/y/yaml-cpp/xmake.lua @@ -1,5 +1,4 @@ package("yaml-cpp") - set_homepage("https://github.com/jbeder/yaml-cpp/") set_description("A YAML parser and emitter in C++") set_license("MIT") @@ -13,14 +12,16 @@ package("yaml-cpp") add_versions("0.8.0", "fbe74bbdcee21d656715688706da3c8becfd946d92cd44705cc6098bb23b3a16") add_deps("cmake") - on_load("windows", function (package) + + on_load("windows", "mingw", function (package) if not package:config("shared") then package:add("defines", "YAML_CPP_STATIC_DEFINE") end end) - on_install("windows", "linux", "macosx", "mingw", function (package) + on_install(function (package) local configs = {"-DYAML_CPP_BUILD_TESTS=OFF"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DYAML_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) if package:is_plat("windows") then table.insert(configs, "-DYAML_MSVC_SHARED_RT=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON")) @@ -30,5 +31,9 @@ package("yaml-cpp") end) on_test(function (package) - assert(package:has_cxxtypes("YAML::Parser", {configs = {languages = "c++11"}, includes = "yaml-cpp/yaml.h"})) + assert(package:check_cxxsnippets({test = [[ + void test() { + YAML::Load(""); + } + ]]}, {configs = {languages = "c++11"}, includes = "yaml-cpp/yaml.h"})) end)