Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script chooses gcc over VC if on path. #32

Open
asbe opened this issue Nov 8, 2016 · 4 comments
Open

Build script chooses gcc over VC if on path. #32

asbe opened this issue Nov 8, 2016 · 4 comments

Comments

@asbe
Copy link

asbe commented Nov 8, 2016

Hi, I accidentially had gcc installed (http://tdm-gcc.tdragon.net) - and this breaks the build script. [Output not pasted - ninja fails a subcommand on the variable "toolset"]

I assume it is a bug and not a feature that gcc is chosen as compiler if available, when running the build_v1*0_x64.cmd scripts?

Asbjørn

@willyd
Copy link
Owner

willyd commented Nov 8, 2016

@asbe Can you echo the PATH after vcvarsall.bat has been called?

Some people have had success by specifying the compiler path like so: -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe

@asbe
Copy link
Author

asbe commented Nov 8, 2016

Hi. I worked around it by removing the gcc compiler suite - but I assume this also could be fixed by checking what compiler is reported used? Literally the first output of your script is "The C compiler identification is MSVC 18.0.21005.1", and when the id was Gnu 5.1 I realized that gcc was used - the Ninja errors were slightly confusing.

I'll try to get around to reinstalling gcc and have a poke around - if it helps.

@AvenSun
Copy link

AvenSun commented Nov 20, 2016

same problem !
vs2013 && tdm installed, tdm is chosen as compiler.

@willyd
Copy link
Owner

willyd commented Nov 24, 2016

CMake found gcc.exe on your path. You need to it tell it to use cl.exe either by executing:

set CC=cl
set CXX=cl

in a command prompt before you execute CMake or by adding -DCMAKE_C_COMPILER=cl and -DCMAKE_CXX_COMPILER=cl on the cmake command.

Make sure to delete the build folder and start over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants