I'm trying to compile a single codebase for both ArmV8 aarch64 and aarch32 with GCC. My code requires the -mfloat-abi=hard
flag and possibly others when compiled for aarch32, but not for aarch64.
I have multiple toolchains so I created two toolchain files. What's the most idiomatic CMake way to add this flag only when the aarch32 toolchain file is used?
Of course I could do this inside the project CMakeLists.txt file, at the point where I already created the target and I'm setting other compiler flags. But then I would have to add this flag conditionally depending on the toolchain, which seems to defeat the point of having two neatly separated toolchain files.