C++: Make it possible to split up the C++ code generated for a .slint file

Add a COMPILATION_UNITS argument to slint_target_sources that defines into how many .cpp files to split up a .slint file. The new default is now one.
This commit is contained in:
Simon Hausmann 2024-08-18 15:04:50 +02:00 committed by Simon Hausmann
parent 12f5343cd8
commit c25a03d6f7
6 changed files with 160 additions and 31 deletions

View file

@ -20,8 +20,10 @@ pub fn test(testcase: &test_driver_lib::TestCase) -> Result<(), Box<dyn Error>>
let mut diag = BuildDiagnostics::default();
let syntax_node = parser::parse(source.clone(), Some(&testcase.absolute_path), None, &mut diag);
let output_format =
generator::OutputFormat::Cpp(generator::cpp::Config { namespace: cpp_namespace });
let output_format = generator::OutputFormat::Cpp(generator::cpp::Config {
namespace: cpp_namespace,
..Default::default()
});
let mut compiler_config = CompilerConfiguration::new(output_format.clone());
compiler_config.include_paths = include_paths;