Large C++ files generated from .slint files can cause link problems with MSVC.
When that happens, MSVC itself suggests /bigobj as remedy.
It's not apparent that there's a downside to using this option, apart from
backwaords binary compatibility - which is not a concern for us.
The discussion at https://developercommunity.visualstudio.com/t/Enable-bigobj-by-default/1031214 suggests that perhaps this
will become the default one day.
To simplify our examples and avoid users running into this, let's enable it by default.
The Furo theme by default generates a "on this page" contents list in
the right column. The breathe output for C++ namespace and file pages
also includes a ::contents:: RST directive, to summarize the available
headings. The duplication of these two is warned about by furo with a
big fat red warning.
Solve this by not making breathe generate the contents directive
anymore. According to
https://exhale.readthedocs.io/en/latest/reference/configs.html?highlight=contentsspecifier#exhale.configs.kindsWithContentsDirectives
it's by default used for files and namespace, so make it empty in our
config.
Fixes#2505
The ImageCacheKey enum has a gap when not targeting wasm:
```
pub enum ImageCacheKey {
/// This variant indicates that no image cache key can be created for the image.
/// For example this is the case for programmatically created images.
Invalid,
/// The image is identified by its path on the file system.
Path(SharedString),
/// The image is identified by a URL.
#[cfg(target_arch = "wasm32")]
URL(SharedString),
/// The image is identified by the static address of its encoded data.
EmbeddedData(usize),
}
```
In the C++ generated header, that cfg was not mapped, and thus the URL
variant was always there, while in a regular slint-cpp build it's not.
Consequently tag value 2 in Rust was used to represent the EmbeddedData
variant, while in the C++ generated code that become variant 3 and 2 was
interpreted as a URL. So the receiving code in C++ tried to interpret
the cache key as URL variant, while Rust created it as EmbeddedData.
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
We have plenty of command lines that explicitly use `-GNinja`, so let's
make Ninja a tool that is required. That's easier than changing all the
command lines to have two variants (use XX or YY if you have Ninja
installed), and we know that the dependency handling works best with
Ninja.
Fixes#2495
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
Amend 8406e1050d by fixing the condition
to apply the install_name when the cache variable used to detect package
builds is defined, not _not_ defined.
cc #2075
Set install_name to include rpath as per commit
916b927f4f only when doing top-level
builds that are meant to be installed via "make install".
cc #2075
Thanks to @jschwe, there's a way to instruct corrosion to supply link
flags that set the install name and work around cargo/rustc behavior.
In exchange, now that we're using rpath, to be able to continue to run
the tests and examples against a build tree, we need to set
CMAKE_BUILD_RPATH.
Fixes#2075