Additional update when trying to do it the proper way as it probably should be intended.
1)Add macro definitions in rtconfig.h
In my example:
#define HAL_ETH_MODULE_ENABLED
#define BSP_USING_ETH
#ifdef BSP_USING_ETH
#define PHY_USING_LAN8720A /* Same registers as 8742A */
#endif
2) Right click the entire project folder and click "Packages Update".
The drv_eth.c, stm32h7xx_hal_eth.c and stm32h7xx_hal_eth_ex.c should now also be compiled.
Ask Enable studio IDE to compile drv_eth.c (RT thread 4.0.3)