From d60e9b244f091593232fffae837ec0504c51f032 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 23 Apr 2025 16:37:21 +0200 Subject: (C++ modules support) assert when unity_build is enabled --- xmake/rules/c++/modules/config.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xmake/rules/c++/modules/config.lua b/xmake/rules/c++/modules/config.lua index a39e4c4e0..90d34cfdc 100644 --- a/xmake/rules/c++/modules/config.lua +++ b/xmake/rules/c++/modules/config.lua @@ -25,6 +25,10 @@ function main(target) -- we disable to build across targets in parallel, because the source files may depend on other target modules -- @see https://github.com/xmake-io/xmake/issues/1858 if support.contains_modules(target) then + + -- unity build can't work with modules + assert(not target:rule("c++.unity_build"), "C++ unity build is not compatible with C++ modules") + -- @note this will cause cross-parallel builds to be disabled for all sub-dependent targets, -- even if some sub-targets do not contain C++ modules. -- -- cgit v1.3.1