Lameguy64 / mkpsxiso

ISO disc image maker written specifically for PlayStation homebrew development
GNU General Public License v2.0
214 stars 33 forks source link

CMake script rewrite, installation rules, MSVC fix #18

Closed spicyjpeg closed 2 years ago

spicyjpeg commented 3 years ago

I'm working on CMake integration for PSn00bSDK and made some tweaks to the mkpsxiso build script to make automated installation easier (so the SDK can automatically set it up to build the examples).

I added proper installation rules (now cmake --install can be invoked to install mkpsxiso system-wide) and improved the logic for finding tinyxml2, which can now be installed using vcpkg or even manually from its repo. The PSn00bSDK setup script will auto-download tinyxml2 and use it to build both mkpsxiso and the tools bundled with the SDK.

I also got rid of the ugly platform checks and edited the sources to make them compile with MSVC. I had to bump the minimum required CMake version to 3.21 as support for installing executable dependencies (tinyxml2 DLL) has only been added very recently.

marco-calautti commented 2 years ago

I see some issues with how variable length arrays are now handled to support MSVC. With Variable length arrays, their data were automatically freed when exiting their scope like standard stack variables. Now they are allocated with new, but there is no corresponding delete[] at the end of the function where they are created, and this might cause memory leaks.

spicyjpeg commented 2 years ago

Thanks for pointing that out, should be fixed now.