Building TouchGFX in Clion, compiler says multiple definition of functions in OSWrappers.cpp
I'm trying to start a project using TouchGFX on stm32H743IIT6 and I generated the project with CubeMX, and when I try to build the project with Clion, there are errors about simulator source files.So I excluded all directories about simulators in cmakelists, and compiling seems to work but there are errors of multiple definition of functions, and after checking, I found that all these multiple definition errors are related to functions in OSWrappers.cpp and OSWrappers_cmsis.cpp. Then I tried to open project in CubeIDE and compile with it, and there are no errors this time, everything is fine. I also tried to generate the project in MDK-ARM form and build it in Keil, still no problem. It seems only Clion can't build the project properly and I'm wondering if there's a way to compile in Clion.
Here are the changes I made in Cmakelists:
file(GLOB_RECURSE excludes "Middlewares/ST/touchgfx/framework/source/platform/hal/simulator/*.*" "Middlewares/ST/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp" "TouchGFX/generated/simulator/*.*" "TouchGFX/simulator/*.*")
list(REMOVE_ITEM SOURCES ${excludes})
added after
file(GLOB_RECURSE SOURCES "TouchGFX/*.*" "Core/*.*" "Middlewares/*.*" "Drivers/*.*")
