Currently, when CMake is cross compiling, it sets
TRUE. This also ends up meaning we can't compile any tools for code generation or otherwise when cross compiling. This is a huge limitation. However, there is a workaround and we can wrap it up into a special
This command will perform the following steps when
- Get the current list of enabled languages.
- For each language we
unset() certain variables in the current function scope.
set() the current
CMAKE_SYSTEM_NAME into a temporary variable
set(CMAKE_PLATFORM_INFO_DIR) to some predetermined directory
set() host versions of variables
- Set variables onto a
dict() and save to disk with some sort of hash
try_compile(PROJECT) with flags that are stored in said
dict() (We cannot use generator expressions 😞). The project can either be the current one, or a separate one altogether.
add_executable(name IMPORTED) and set the path to the given target.
The above is just the tip of the iceberg. There are many MANY things that need to be taken into account, such as, but not limited to:
- FetchContent locations
- System Dependencies
- Variables set by toolchain files
This is going to be a big feature, but it is EXTREMELY useful. That said, it's low priority until everything else is stable.
✨ enhancement ✨ modules 🔮 tools 🛠️