raspberrypi / pico-project-generator

Tool to automatically generate a Pico C SDK Project
BSD 3-Clause "New" or "Revised" License
289 stars 74 forks source link

Doesn't work with MinGW on Windows #59

Closed BryanCrotaz closed 1 year ago

BryanCrotaz commented 1 year ago

I have the examples building successfully with MinGW and VSCode to avoid the multi-gigabyte Visual Studio Tools download.

However when I create my own project using pico-project-generator I get

CMake Error at CMakeLists.txt:15 (project):
  Running 'nmake' '-?'
failed with:
  The system cannot find the file specified
BryanCrotaz commented 1 year ago

I'm not enough of an expert in python to do this - needs a wake to find if nmake exists:

Line 1187 of pico_project.py


    nmakeExists = shutil.which("nmake") // will this work??
    if isWindows:
        if nmakeExists:
            cmakeCmd = 'cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" ..'
            makeCmd = 'nmake '
        else:
            cmakeCmd = 'cmake -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" ..'
            makeCmd = 'mingw32-make '

The latter version works on my system (without the if nmakeExists)

JamesH65 commented 1 year ago

Latest commit on master should support this. 203c601dd577160a4c518706b4d6ecc48d0ec367 I am unable to test this as I don't have a Windows system with MinGW, so if you have time to try it out that would be appreciated.

JamesH65 commented 1 year ago

Given no further reports of it failing after the fix, I'll close this issue. This area has also been updated to support Ninja.