diff options
| author | ruki <[email protected]> | 2022-06-30 22:35:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-06-30 09:36:35 +0800 |
| commit | 4c352130e376592dab4ec8724001c8df7d9d924d (patch) | |
| tree | 0d3a20bdd45892267f301c3e3bbea01e8fa7134d | |
| parent | 2b30eff4ddbbcc2462ed075fc40b39ecd360240b (diff) | |
improve unity build
| -rw-r--r-- | xmake/plugins/project/main.lua | 4 | ||||
| -rw-r--r-- | xmake/rules/c++/unity_build/unity_build.lua | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua index 90cdc0695..08337b9bb 100644 --- a/xmake/plugins/project/main.lua +++ b/xmake/plugins/project/main.lua @@ -82,6 +82,9 @@ end -- main function main() + -- in project generator? + os.setenv("XMAKE_IN_PROJECT_GENERATOR", "true") + -- config it first task.run("config") @@ -90,4 +93,5 @@ function main() -- trace cprint("${color.success}create ok!") + os.setenv("XMAKE_IN_PROJECT_GENERATOR", nil) end diff --git a/xmake/rules/c++/unity_build/unity_build.lua b/xmake/rules/c++/unity_build/unity_build.lua index 5e7a14598..ad93753c0 100644 --- a/xmake/rules/c++/unity_build/unity_build.lua +++ b/xmake/rules/c++/unity_build/unity_build.lua @@ -73,6 +73,11 @@ end -- function main(target, sourcebatch) + -- we cannot generate unity build files in project generator + if os.getenv("XMAKE_IN_PROJECT_GENERATOR") then + return + end + -- get unit batch sources local extraconf = target:extraconf("rules", sourcebatch.sourcekind == "cxx" and "c++.unity_build" or "c.unity_build") local batchsize = extraconf and extraconf.batchsize |
