As discussed a good bit with fanquake and hebasto. Would be nice to have for v29, but it’s very late, so no worries if it doesn’t make it.
Fundamentally, this creates a “Depends” build type which represents the flags that were used to build depends as opposed to colliding with the other types.
This allows the forwarding of optional flags into the CMake build for the “Depends” build type, but the user can now optionally use an existing (Debug/RelWitDebInfo/etc.) type to ignore the optimization flags set by depends and use the ones from that type instead.
As an example, a user may do: make -C depends cmake –toolchain depends/arm64-apple-darwin/toolchain.cmake -DCMAKE_BUILD_TYPE=Debug
This would compile depends with the default optimization flags for depends (-O2) but build Core with the default debug optimization flags from CMake
Depends note: For hosts, $host_*FLAGS variables now represent the mandatory flags for compiling and will be forwarded to all Core builds via the toolchain file, regardless of the build type. For most platforms they should be empty, but are useful at least for darwin.
When setting (for example) CFLAGS from the command line when building depends, these flags will be stored in $host_release_CFLAGS (or debug), and will only be forwarded to the Depends build type.