Generic-SDCC-C.cmake contains defaults for 8015 which mess up when building for other target than that (e.g. STM8, PIC, S08)
There are kind of defaults for 8051 controller in this file which should not be there as the file is GENERIC. If one does not provide CMAKE_C_FLAGS_INIT and CMAKE_EXE_LINKER_FLAGS_INIT one will get the flags as are defined in this file. For other target than 8051, who don't support these flags at all, this will cause your project not to compile. The reasons why it does not compile are not obvious to track down as they are inside the cmake modules and this is not the first place to look at. it took me hours to figure out why I got these flags --model-small in my linker call..
Please remove these lines:
if(NOT DEFINED CMAKE_C_FLAGS_INIT)
string(APPEND CMAKE_C_FLAGS_INIT " -mmcs51 --model-small")
endif()
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
set (CMAKE_EXE_LINKER_FLAGS_INIT --model-small)
endif()