Can a library project have a main.cpp?

I have a project with a couple of unity tests and a number of *.h and *.cpp files.

The only way I could get the unit tests to run and use it as a ‘syslink’ library in another project was to place header files in iinclude and CPP file in src, add the test_build_src = yes

I would like to add a main.cpp to the project - but that breaks the unit tests as the linker ‘sees’ multiple setup and loop methods - i think from src/main.cpp and the actual unit test files.

Is there a work around? Could I put the main.cpp in another directory? Or must I move it to another project?

Oddly enough I have another ‘library’ project that has unit test, a main and all header and CPP files in src and it works fine.