diff options
| author | ruki <[email protected]> | 2017-07-19 09:42:52 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-19 09:42:52 +0800 |
| commit | 93ec0e112c5ccb4a2acd1ba5a36320218cd73c7e (patch) | |
| tree | 03f565e1764c53258ce51c35caa39cc9f895a29c | |
| parent | bfe4432515a8816edc1d32ccfe646096b3ff9c95 (diff) | |
fix option checking
| -rw-r--r-- | core/pkg/tbox.pkg/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/core/project/option.lua | 3 | ||||
| -rw-r--r-- | xmake/core/project/project.lua | 4 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/core/project/project.lua | 12 |
4 files changed, 18 insertions, 3 deletions
diff --git a/core/pkg/tbox.pkg/xmake.lua b/core/pkg/tbox.pkg/xmake.lua index c6bc5ee18..50e568b7a 100644 --- a/core/pkg/tbox.pkg/xmake.lua +++ b/core/pkg/tbox.pkg/xmake.lua @@ -15,7 +15,7 @@ option("tbox") set_languages("c99", "cxx11")
-- add defines to config.h if checking ok
- add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_TBOX")
+ add_defines_h("$(prefix)_PACKAGE_HAVE_TBOX")
-- add links for checking
add_links("tbox")
diff --git a/xmake/core/project/option.lua b/xmake/core/project/option.lua index daee85a69..748ef03e5 100644 --- a/xmake/core/project/option.lua +++ b/xmake/core/project/option.lua @@ -112,6 +112,9 @@ function option:_cx_check() if results_or_errors then self:enable(true) end + else + -- no checked conditions, passed directly + self:enable(true) end end diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 14b9b7e7e..a6f2b6c4a 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -363,7 +363,7 @@ function project._load_targets() assert(interp) -- enter the project directory - local ok, errors = os.cd(project.directory()) + local ok, errors = os.cd(os.projectdir()) if not ok then return nil, errors end @@ -428,7 +428,7 @@ function project._load_options(disable_filter) assert(interp) -- enter the project directory - local ok, errors = os.cd(project.directory()) + local ok, errors = os.cd(os.projectdir()) if not ok then return nil, errors end diff --git a/xmake/core/sandbox/modules/import/core/project/project.lua b/xmake/core/sandbox/modules/import/core/project/project.lua index b9e1d248e..8ea938d0d 100644 --- a/xmake/core/sandbox/modules/import/core/project/project.lua +++ b/xmake/core/sandbox/modules/import/core/project/project.lua @@ -58,6 +58,12 @@ function sandbox_core_project.check() local instance = sandbox.instance() assert(instance) + -- enter the project directory + local ok, errors = os.cd(os.projectdir()) + if not ok then + raise(errors) + end + -- enter toolchains environment environment.enter("toolchains") @@ -93,6 +99,12 @@ function sandbox_core_project.check() -- leave toolchains environment environment.leave("toolchains") + + -- leave the project directory + local ok, errors = os.cd("-") + if not ok then + raise(errors) + end end -- get the given target |
