diff options
8 files changed, 29 insertions, 46 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua index 300b3f5e1..6a5772e8f 100644 --- a/xmake/modules/package/tools/xmake.lua +++ b/xmake/modules/package/tools/xmake.lua @@ -34,6 +34,7 @@ function install(package, configs) for _, name in ipairs(names) do local value = get_config(name) if value ~= nil then + value = tostring(value) if value:find(" ", 1, true) then value = '"' .. value .. '"' end @@ -50,7 +51,31 @@ function install(package, configs) end table.insert(argv, "--" .. name .. "=" .. value) end + if option.get("verbose") then + table.insert(argv, "-v") + end + if option.get("backtrace") then + table.insert(argv, "--backtrace") + end + os.vrunv("xmake", argv) + + -- do build + argv = {} + if option.get("verbose") then + table.insert(argv, "-v") + end + if option.get("backtrace") then + table.insert(argv, "--backtrace") + end + os.vrunv("xmake", argv) + + -- do install + argv = {"install", "-y", "-o", package:installdir()} + if option.get("verbose") then + table.insert(argv, "-v") + end + if option.get("backtrace") then + table.insert(argv, "--backtrace") + end os.vrunv("xmake", argv) - os.vrun("xmake" .. (option.get("verbose") and " -v" or "")) - os.vrunv("xmake", {"install", "-o", package:installdir()}) end diff --git a/xmake/platforms/android/check.lua b/xmake/platforms/android/check.lua index cb1cc6436..cd4c8b786 100644 --- a/xmake/platforms/android/check.lua +++ b/xmake/platforms/android/check.lua @@ -31,8 +31,8 @@ function _check_ndk(config) local ndk = find_ndk(config.get("ndk"), {force = true, verbose = true}) if ndk then config.set("ndk", ndk.sdkdir, {force = true, readonly = true}) -- maybe to global - config.set("bin", ndk.bindir) - config.set("cross", ndk.cross) + config.set("bin", ndk.bindir, {force = true, readonly = true}) + config.set("cross", ndk.cross, {force = true, readonly = true}) else -- failed cprint("${bright red}please run:") diff --git a/xmake/templates/c++/console_tbox/project/xmake.lua b/xmake/templates/c++/console_tbox/project/xmake.lua index 68cc9cfb7..0babdcd1e 100644 --- a/xmake/templates/c++/console_tbox/project/xmake.lua +++ b/xmake/templates/c++/console_tbox/project/xmake.lua @@ -11,10 +11,6 @@ set_languages("c99", "cxx11") add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") --- set the object files directory -set_objectdir("$(buildir)/$(mode)/$(arch)/.objs") -set_targetdir("$(buildir)/$(mode)/$(arch)") - -- the debug mode if is_mode("debug") then @@ -37,9 +33,6 @@ if is_mode("release") then -- strip all symbols set_strip("all") - -- fomit the frame pointer - add_cxflags("-fomit-frame-pointer") - -- enable fastest optimization set_optimize("fastest") end diff --git a/xmake/templates/c++/shared_library_tbox/project/xmake.lua b/xmake/templates/c++/shared_library_tbox/project/xmake.lua index 4b16c1995..472339253 100644 --- a/xmake/templates/c++/shared_library_tbox/project/xmake.lua +++ b/xmake/templates/c++/shared_library_tbox/project/xmake.lua @@ -11,10 +11,6 @@ set_languages("c99", "cxx11") add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") --- set the object files directory -set_objectdir("$(buildir)/$(mode)/$(arch)/.objs") -set_targetdir("$(buildir)/$(mode)/$(arch)") - -- the debug mode if is_mode("debug") then @@ -37,9 +33,6 @@ if is_mode("release") then -- strip all symbols set_strip("all") - -- fomit the frame pointer - add_cxflags("-fomit-frame-pointer") - -- enable fastest optimization set_optimize("fastest") end diff --git a/xmake/templates/c++/static_library_tbox/project/xmake.lua b/xmake/templates/c++/static_library_tbox/project/xmake.lua index 4b16c1995..472339253 100644 --- a/xmake/templates/c++/static_library_tbox/project/xmake.lua +++ b/xmake/templates/c++/static_library_tbox/project/xmake.lua @@ -11,10 +11,6 @@ set_languages("c99", "cxx11") add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") --- set the object files directory -set_objectdir("$(buildir)/$(mode)/$(arch)/.objs") -set_targetdir("$(buildir)/$(mode)/$(arch)") - -- the debug mode if is_mode("debug") then @@ -37,9 +33,6 @@ if is_mode("release") then -- strip all symbols set_strip("all") - -- fomit the frame pointer - add_cxflags("-fomit-frame-pointer") - -- enable fastest optimization set_optimize("fastest") end diff --git a/xmake/templates/c/console_tbox/project/xmake.lua b/xmake/templates/c/console_tbox/project/xmake.lua index 68cc9cfb7..0babdcd1e 100644 --- a/xmake/templates/c/console_tbox/project/xmake.lua +++ b/xmake/templates/c/console_tbox/project/xmake.lua @@ -11,10 +11,6 @@ set_languages("c99", "cxx11") add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") --- set the object files directory -set_objectdir("$(buildir)/$(mode)/$(arch)/.objs") -set_targetdir("$(buildir)/$(mode)/$(arch)") - -- the debug mode if is_mode("debug") then @@ -37,9 +33,6 @@ if is_mode("release") then -- strip all symbols set_strip("all") - -- fomit the frame pointer - add_cxflags("-fomit-frame-pointer") - -- enable fastest optimization set_optimize("fastest") end diff --git a/xmake/templates/c/shared_library_tbox/project/xmake.lua b/xmake/templates/c/shared_library_tbox/project/xmake.lua index 4b16c1995..472339253 100644 --- a/xmake/templates/c/shared_library_tbox/project/xmake.lua +++ b/xmake/templates/c/shared_library_tbox/project/xmake.lua @@ -11,10 +11,6 @@ set_languages("c99", "cxx11") add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") --- set the object files directory -set_objectdir("$(buildir)/$(mode)/$(arch)/.objs") -set_targetdir("$(buildir)/$(mode)/$(arch)") - -- the debug mode if is_mode("debug") then @@ -37,9 +33,6 @@ if is_mode("release") then -- strip all symbols set_strip("all") - -- fomit the frame pointer - add_cxflags("-fomit-frame-pointer") - -- enable fastest optimization set_optimize("fastest") end diff --git a/xmake/templates/c/static_library_tbox/project/xmake.lua b/xmake/templates/c/static_library_tbox/project/xmake.lua index 4b16c1995..472339253 100644 --- a/xmake/templates/c/static_library_tbox/project/xmake.lua +++ b/xmake/templates/c/static_library_tbox/project/xmake.lua @@ -11,10 +11,6 @@ set_languages("c99", "cxx11") add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") --- set the object files directory -set_objectdir("$(buildir)/$(mode)/$(arch)/.objs") -set_targetdir("$(buildir)/$(mode)/$(arch)") - -- the debug mode if is_mode("debug") then @@ -37,9 +33,6 @@ if is_mode("release") then -- strip all symbols set_strip("all") - -- fomit the frame pointer - add_cxflags("-fomit-frame-pointer") - -- enable fastest optimization set_optimize("fastest") end |
