It seems like CMAKE_CXX_FLAGS is getting double appended when building as a nested cmake project, which breaks my build as gcc does not allow -specs=nosys.specs to be called multiple times.
Removing this fixes it and seems to keep the same compile options, just removing the duplicate definition.