diff options
| -rwxr-xr-x | tests/console_c/xmake.lua | 9 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/console_c/xmake.lua b/tests/console_c/xmake.lua index 5bb1a2510..4156f32fc 100755 --- a/tests/console_c/xmake.lua +++ b/tests/console_c/xmake.lua @@ -30,3 +30,12 @@ target("console_c") -- add files add_files("src/*.c") + after_build(function(target) + import("core.project.config") + os.cd("src") + print(config.buildir()) + print(vformat("$(scriptdir)")) + print(path.absolute(vformat("$(buildir)"))) + os.cp("main.c", "$(buildir)/aaa") + end) + diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 6157ce951..40bee0a5e 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -43,6 +43,7 @@ local deprecated_project = require("project/deprecated/project") local platform = require("platform/platform") local environment = require("platform/environment") local language = require("language/language") +local sandbox_os = require("sandbox/modules/os") -- the current os is belong to the given os? function project._api_is_os(interp, ...) @@ -288,6 +289,7 @@ function project._interpreter() , prefix = "$(prefix)" , tmpdir = os.tmpdir() , curdir = os.curdir() + , scriptdir = sandbox_os.scriptdir() , globaldir = global.directory() , configdir = config.directory() , projectdir = project.directory() |
