I have a CMake project that supports multiple platform combination (arm, powerpc ,x86-64). Native platform is x86-64.
I have toolchain.cmake file for each cross-platform build(for arm and powerpc). When I give toolcahin.cmake files for cross-platform build to cmake everything is working as expected except one thing.
In the project I want to build a particular executable with native build support(that is on x86-64). Since I gave toolchain.cmake file explicitly, so all CMAKE_C_FLAGS are global for all executable in project.
So I want to give toolchain.cmake(say for arm) to cmake and want to build the whole project except one executable on native(x86-64) in one go. Is there any way where I can change the complete CMAKE_C_FLAGS and can provide the native one for that particular executable ?
I tried few things as per How to change a compiler flag for just one executable in CMake? but can't get the solution to this problem