summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-21 00:49:09 +0800
committerruki <[email protected]>2020-02-20 22:54:57 +0800
commit12d44e1e32132c859df769247d8e459388071bb5 (patch)
treeb925661646fe2736b95f5ab3936bcb8ec11049e9
parent9dfb87323ac852553ceaf08ffcd4cfc473d2e442 (diff)
enable verbose for cmake/make
-rw-r--r--xmake/modules/private/action/trybuild/cmake.lua13
-rw-r--r--xmake/modules/private/action/trybuild/make.lua9
2 files changed, 18 insertions, 4 deletions
diff --git a/xmake/modules/private/action/trybuild/cmake.lua b/xmake/modules/private/action/trybuild/cmake.lua
index 167c8bc50..a1901e2d2 100644
--- a/xmake/modules/private/action/trybuild/cmake.lua
+++ b/xmake/modules/private/action/trybuild/cmake.lua
@@ -45,6 +45,11 @@ function _get_configs(artifacts_dir)
table.insert(configs, "x64")
end
+ -- enable verbose?
+ if option.get("verbose") or option.get("diagnosis") then
+ table.insert(configs, "-DCMAKE_VERBOSE_MAKEFILE=ON")
+ end
+
-- add extra user configs
local tryconfigs = config.get("tryconfigs")
if tryconfigs then
@@ -109,8 +114,12 @@ function build()
os.vexec("msbuild \"%s\" /property:configuration=%s", projfile, is_mode("debug") and "Debug" or "Release")
end
else
- os.vexec("make -j" .. option.get("jobs"))
- os.vexec("make install")
+ local argv = {"-j" .. option.get("jobs")}
+ if option.get("verbose") or option.get("diagnosis") then
+ table.insert(argv, "VERBOSE=1")
+ end
+ os.vexecv("make", argv)
+ os.vexecv("make", {"install"})
end
cprint("output to ${bright}%s", artifacts_dir)
cprint("${bright}build ok!")
diff --git a/xmake/modules/private/action/trybuild/make.lua b/xmake/modules/private/action/trybuild/make.lua
index 01ea217c0..8224298a7 100644
--- a/xmake/modules/private/action/trybuild/make.lua
+++ b/xmake/modules/private/action/trybuild/make.lua
@@ -40,10 +40,15 @@ end
-- do build
function build()
assert(is_subhost(config.plat()), "make: %s not supported!", config.plat())
+ local argv = {}
+ if option.get("verbose") or option.get("diagnosis") then
+ table.insert(argv, "VERBOSE=1")
+ end
if is_subhost("windows") then
- os.vexec("nmake")
+ os.vexecv("nmake", argv)
else
- os.vexec("make -j" .. option.get("jobs"))
+ table.insert(argv, "-j" .. option.get("jobs"))
+ os.vexecv("make", argv)
end
cprint("${bright}build ok!")
end