[Windows] Building project that includes CMake sub-projects always fails

Post Reply
WohlstandFox
Posts: 7
Joined: Tue May 16, 2023 10:57 pm
Contact:

[Windows] Building project that includes CMake sub-projects always fails

Post by WohlstandFox » Wed Dec 04, 2024 9:21 pm

Hello!

It's a long while when problem was been found, but it happens on Windows exclusively: when trying to build any CMake project that has any sub-directory or "ExternalProject" added. Here is a simple project (it builds for Linux with ncurses, for 3DS, for Wii, for Wii U, and for Switch): https://github.com/Wohlstand/MixerXDemoPlayer (when clonning repo, don't forget also submodules!).

That happens, because for unknown reasons, all paths in the submodule's make file (no matter Ninja or GNU Make / MinGW Makefile generator is chosen) contains a mixture of path as with Windows native and MSyS's specific (it starts with MSyS's path, and then a connotated Windows native path, of course this is fully invalid path). And in result, the build fails because resulted makefile is corrupted.

On UNIX-like systems the build goes just fine (tested on Linux mainly).


WohlstandFox
Posts: 7
Joined: Tue May 16, 2023 10:57 pm
Contact:

Re: [Windows] Building project that includes CMake sub-projects always fails

Post by WohlstandFox » Mon Dec 09, 2024 2:47 pm

Some additional info: I also forgot to append if speak about CMake and MSyS environment: When using pure MSyS and the regular MinGW-w64 toolkit to build for Windows itself, the build goes flawless with my another larger project. Maybe take something from their side to ensure correct Make/Ninja-build file?


WinterMute
Site Admin
Posts: 2000
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: [Windows] Building project that includes CMake sub-projects always fails

Post by WinterMute » Tue Dec 10, 2024 9:36 pm

This appears to be some problem with msys2 cmake and Makefiles with your project. I'm not sure how to fix it but it isn't something on our side, the msys2 bundle we supply has only minor differences from "pure msys2" relating to the included repo dbs and a mountpoint so the msys2 shell sees the devkitPro folder as /opt/devkitpro for compatibility with linux & macOS. You can, of course, simply add the dkP repos to a standard msys2 install and have things just work generally but the same issue happens with your project if you use -G"Unix Makefiles" but installing ninja (pacman -S ninja) should get cmake to use ninja as the build system but you can also use -GNinja to make sure. This works for us on windows with your project.

Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests