I am using CMake to build a project for an embedded system, but my unit testing is done on an x86 host. Therefore, I need to use a completely different compiler to build the tests from the one used for the cross-compiled binary.
I have a main CMakeLists.txt file at the top level of my project, and then another one in my testing folder which gets added with add_subdirectory at the top level. Should I just keep them completely separate or is there a better way to accomplish this?
Running my main build without the cross compiler will cause it to fail, so it really needs to be a separate process for the tests.