support for clang

This commit is contained in:
Araq
2011-03-24 01:26:52 +01:00
parent 368bb3b5e2
commit 220dd54acf
2 changed files with 23 additions and 2 deletions

View File

@@ -60,6 +60,7 @@ hint[LineTooLong]=off
@if unix:
@if not bsd:
gcc.options.linker = "-ldl"
clang.options.linker = "-ldl"
tcc.options.linker = "-ldl"
@end
@end
@@ -96,6 +97,12 @@ llvm_gcc.options.always = "-w"
llvm_gcc.options.speed = "-O2"
llvm_gcc.options.size = "-Os"
# Configuration for the LLVM CLang compiler:
clang.options.debug = "-g"
clang.options.always = "-w"
clang.options.speed = "-O3"
clang.options.size = "-Os"
# Configuration for the Visual C/C++ compiler:
vcc.options.linker = r"/F33554432" # set the stack size to 8 MB
vcc.options.debug = "/RTC1 /ZI"

View File

@@ -15,8 +15,8 @@ import
type
TSystemCC* = enum
ccNone, ccGcc, ccLLVM_Gcc, ccLcc, ccBcc, ccDmc, ccWcc, ccVcc, ccTcc, ccPcc,
ccUcc, ccIcc, ccGpp
ccNone, ccGcc, ccLLVM_Gcc, ccCLang, ccLcc, ccBcc, ccDmc, ccWcc, ccVcc,
ccTcc, ccPcc, ccUcc, ccIcc, ccGpp
TInfoCCProp* = enum # properties of the C compiler:
hasSwitchRange, # CC allows ranges in switch statements (GNU C)
hasComputedGoto, # CC has computed goto (GNU C extension)
@@ -72,6 +72,20 @@ const
debug: "", pic: "-fPIC",
asmStmtFrmt: "asm($1);$n",
props: {hasSwitchRange, hasComputedGoto, hasCpp}),
(name: "clang",
objExt: "o",
optSpeed: " -O3 -ffast-math ",
optSize: " -Os -ffast-math ",
compilerExe: "clang",
compileTmpl: "-c $options $include -o $objfile $file",
buildGui: " -mwindows",
buildDll: " -shared",
linkerExe: "clang",
linkTmpl: "$options $buildgui $builddll -o $exefile $objfiles",
includeCmd: " -I",
debug: "", pic: "-fPIC",
asmStmtFrmt: "asm($1);$n",
props: {hasSwitchRange, hasComputedGoto, hasCpp}),
(name: "lcc",
objExt: "obj",
optSpeed: " -O -p6 ",