Both SDCC and Cosmic are C compilers, so you'd just use the C source files.
But:
- All STM8 compilers use slightly different syntax for language extensions, in particular you'll have to make minor changes to the declarations of the interrupt functions, and to inline asm.
- SDCC (and IAR) has better C standard support than Cosmic (and Raisonance). So the source written for SDCC might use some ISO C99 / C11 / C17 features not yet supported by Cosmic.
- SDCC tends to generate faster code than Cosmic, so you might run into performance issues.