I would like to build my application using clang when generating a Makefile (gmake toolchain). Is there a way to do this?
Here is what I use, it works for me:
-- ugly hack to use clang
premake.gcc.cc = 'clang'
premake.gcc.cxx = 'clang++'
Nothing else seemed to work at all.
On premake5, use
#!/bin/bash
premake-5.0.0-alpha11-linux --file=PA7.lua --cc=clang --verbose gmake
--cc=clang
is analogue of --platform option in premake4.
I ultimately ended up doing what @Burton Samograd did: assign the CC environment variable. However, buried deep in the premake4 message boards they do have a way to define a new platform.
When using premake4, just invoke:
premake4 --platform=clang gmake
The only problem I've found with this is it didn't work as I expected. I'm giving my vote to Burton, but the information is here if you want it.
It looks like you can just set the CC varaible:
CC ?= /usr/bin/clang
in your premake file. The ?= only sets it if you haven't set it in your environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With