alandefreitas / cpp-actions

GitHub Actions for C++ Libraries
https://alandefreitas.github.io/cpp-actions/
Boost Software License 1.0
17 stars 2 forks source link

MinGW actions don't use MinGW with CMake #4

Closed cmazakas closed 7 months ago

cmazakas commented 7 months ago

In order to use MinGW with CMake, specifying the compilers isn't enough as CMake will simply ignore them and then default back to cl.exe

The cpp-matrix action should include something such as:

} else if (compilerName === 'mingw') {
    entry['cxx'] = `g++`
    entry['cc'] = `gcc`
    entry['generator'] = 'MinGW Makefiles'
}

In addition to this, CMake doesn't seem to then like the C:\mingw64\bin\g++ paths and will complain about invalid escapes so I found I needed to add this:

compiler_path = compiler_path.replaceAll('\\','/')

in setup-cpp/index.js

cmazakas commented 7 months ago

https://github.com/alandefreitas/cpp-actions/actions/runs/7224235865/job/19685067880#step:9:299

Yeah, @alandefreitas this is exactly what I ran into! Did you eventually find a fix for this?

alandefreitas commented 7 months ago

Just fixed this one. There were a number of other things that needed to change but it should be good now.