From 84a7e19410fa887b372c2e03abdac514712eefc9 Mon Sep 17 00:00:00 2001 From: Arthur Laurent Date: Sat, 17 Sep 2022 01:37:20 +0200 Subject: [PATCH] Add WIL (#1490) * Add WIL * [WIL] Allow package only on windows * [WIL] Remove CMake dependency * [WIL] Enable package on Mingw * [WIL] add missing windows.h for test * [WIL] Fix Test * Revert "[WIL] Enable package on Mingw" This reverts commit b24cf92cbbd955412ffaebdd24edc64e3a483166. --- packages/w/wil/xmake.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/w/wil/xmake.lua diff --git a/packages/w/wil/xmake.lua b/packages/w/wil/xmake.lua new file mode 100644 index 000000000..5323a53b7 --- /dev/null +++ b/packages/w/wil/xmake.lua @@ -0,0 +1,22 @@ +package("wil") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/microsoft/wil") + set_description("The Windows Implementation Libraries (WIL) is a header-only C++ library created to make life easier for developers on Windows through readable type-safe C++ interfaces for common Windows coding patterns.") + set_license("MIT") + + add_urls("https://github.com/microsoft/wil.git") + add_versions("2022.09.16", "5f4caba4e7a9017816e47becdd918fcc872039ba") + + on_install("windows", function (package) + os.cp("include", package:installdir()) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + auto foo = wil::GetModuleInstanceHandle(); + } + ]]}, {configs = {languages = "c++17"}, includes = {"windows.h", "wil/win32_helpers.h"}})) + end)