Under Msys2 MinGW, I would try building using the configure/make method.
Link to patch to help build using that method https://github.com/stahta01/MINGW-packages/blob/codeblocks-git/mingw-w64-codeblocks/003-fix-link-to-tinyxml.patch (https://github.com/stahta01/MINGW-packages/blob/codeblocks-git/mingw-w64-codeblocks/003-fix-link-to-tinyxml.patch)
Configure options that are likely needed
--disable-pch --with-contrib-plugins=all,-Valgrind