algorithm-archivists / algorithm-archive

A collaborative book on algorithms
https://www.algorithm-archive.org
MIT License
2.35k stars 354 forks source link

Force SCons to use GCC when building .c files #928

Closed PeanutbutterWarrior closed 2 years ago

PeanutbutterWarrior commented 2 years ago

This fixes SCons on Windows when MSVC is installed. Previously it would attempt to use MSVC, but fail due to trying to pass it gcc libraries to link.

This needs testing on Linux before it is merged.

It may be better to have the sconstruct file detect which compiler is being used and adjust the calling based on that, so users with only MSVC or with clang can also build. Fixing it for now would still seem prudent, and we can change the behaviour later if wanted.

Amaras commented 2 years ago

I can confirm it runs as previously on my Ubuntu Linux machine. I will review the changes more fully later

Amaras commented 2 years ago

Alright, so the changes are quite simple, but I feel they are a bit too hard coded, especially when we're gonna add many more languages. I'm still okay with this though. (Not approving yet because I want to keep the discussion open)

PeanutbutterWarrior commented 2 years ago

The most recent changes don't work, SCons has the same behaviour as before my commit.