mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-05 11:24:08 +00:00
support for clang
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 ",
|
||||
|
||||
Reference in New Issue
Block a user