瀏覽代碼

pass flags for test.lua

ruki 5 年之前
父節點
當前提交
d826617c5c
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      scripts/test.lua

+ 12 - 0
scripts/test.lua

@@ -11,6 +11,9 @@ local options =
 ,   {nil, "shallow",    "k",  nil, "Only install the root packages." }
 ,   {'p', "plat",       "kv", nil, "Set the given platform."         }
 ,   {'a', "arch",       "kv", nil, "Set the given architecture."     }
+,   {nil, "cflags",     "kv", nil, "Set the cflags."                 }
+,   {nil, "cxxflags",   "kv", nil, "Set the cxxflags."               }
+,   {nil, "ldflags",    "kv", nil, "Set the ldflags."                }
 ,   {nil, "ndk",        "kv", nil, "Set the android NDK directory."  }
 ,   {nil, "mingw",      "kv", nil, "Set the MingW directory."        }
 ,   {nil, "packages",   "vs", nil, "The package list."               }
@@ -37,6 +40,15 @@ function _require_packages(argv, packages)
     if argv.mingw then
         table.insert(config_argv, "--mingw=" .. argv.mingw)
     end
+    if argv.cflags then
+        table.insert(config_argv, "--cflags=" .. argv.cflags)
+    end
+    if argv.cxxflags then
+        table.insert(config_argv, "--cxxflags=" .. argv.cxxflags)
+    end
+    if argv.ldflags then
+        table.insert(config_argv, "--ldflags=" .. argv.ldflags)
+    end
     os.vexecv("xmake", config_argv)
     local require_argv = {"require", "-f", "-y"}
     if argv.verbose then