瀏覽代碼

[Volk] Fix test when use header_only config (#1185)

Arthapz 3 年之前
父節點
當前提交
8ba47057dc
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      packages/v/volk/xmake.lua

+ 11 - 1
packages/v/volk/xmake.lua

@@ -51,5 +51,15 @@ package("volk")
     end)
 
     on_test(function (package)
-        assert(package:has_cfuncs("volkInitialize", {includes = "volk.h"}))
+        local defines
+        if package:config("header_only") then 
+            defines = "VOLK_IMPLEMENTATION"
+        end
+
+        assert(package:check_csnippets({test = format([[
+            #include <volk.h>
+            void test() {
+                volkInitialize();
+            }
+        ]], {configs = {defines = defines}})}))
     end)