question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CMake is finding GCC when building in Windows with `-G "Ninja"` in Azure Pipelines

See original GitHub issue

This recipe is building in AppVeyor, but is failing in Azure Pipelines (win64):

%SRC_DIR%>SET "CMAKE_GENERATOR=Visual Studio 14 2015 Win64"  

%SRC_DIR%>CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\..\..\VC\vcvarsall.bat" amd64  
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/ProgramData/chocolatey/bin/gcc.exe
-- Check for working C compiler: C:/ProgramData/chocolatey/bin/gcc.exe -- broken
CMake Error at D:/bld/cminpack_1550515875602/_build_env/Library/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "C:/ProgramData/chocolatey/bin/gcc.exe"

  is not able to compile a simple test program.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
thewtexcommented, Mar 25, 2019

In addition to sourcing vcvars, the compiler should be explicitly specified for CMake. This is possible with -DCMAKE_CXX_COMPILER=cl.exe and -DCMAKE_C_COMPILER=cl.exe or setting the standard environmental variables CC=cl.exe, CXX=cl.exe.

1reaction
tadeucommented, Feb 10, 2020

The issue seems fixed (probably on Azure side), I’ve temporarily changed the recipe with the original problem to use Ninja again, and it is working! Feel free to close it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the "Ninja" generator in Hosted VS2017 build ...
The ultimate question is: How do I set up an Azure DevOps build pipeline for a CMake-based project using the Ninja generator? cmake...
Read more >
Configure and build with CMake Presets in Visual Studio
Reference for using CMake Presets to configure and build CMake projects. ... Run CMake from the command line or a CI pipeline ......
Read more >
CMake integration with Ninja generator fails to find the right ...
What can I do to make Ninja find the right compiler? This is the current output: 1> CMake Build Type: Debug 1> --...
Read more >
cmake -G Ninja failes on windows, need help - Google Groups
Hi, the cmake Ninja generater creates build commands like this: c:\PROGRA~1\MICROS~4\VC\bin\cl.exe /nologo /D_DEBUG /MDd /Zi /Ob0 /
Read more >
Build VCVRack with Conan and CMake + add CI - Development
added Azure CI pipeline setup for automated building of VCVRack on Azure ... Rack - under Windows please call activate_run.bat and cmake -G...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found