Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell premake to generate a Makefile that uses clang?

I would like to build my application using clang when generating a Makefile (gmake toolchain). Is there a way to do this?

like image 409
Tamás Szelei Avatar asked May 01 '12 20:05

Tamás Szelei


4 Answers

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.

like image 140
Frank Avatar answered Nov 07 '22 15:11

Frank


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.

like image 4
sdd Avatar answered Nov 07 '22 17:11

sdd


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.

like image 2
JRL Avatar answered Nov 07 '22 15:11

JRL


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.

like image 1
Burton Samograd Avatar answered Nov 07 '22 15:11

Burton Samograd