Source code for gdeps.clang
#!python3
# Copyright 2007-2017 Gemr. All Rights Reserved.
# Licensed to MIT see LICENSE.txt
import os
import gdeps as GDeps
__author__ = 'Suryavarman (http://sourceforge.net/u/suryavarman/profile/)'
[docs]class Clang(GDeps.Compiler):
""" @link http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain
@link http://clang.llvm.org/docs/UsersManual.html#id7
"""
def __init__(self, inConfigFile, inSectionName, inDir, inAdressModel, inTypeName):
GDeps.Compiler.__init__(self, inConfigFile, inSectionName, inDir, inAdressModel, inTypeName)
self.m_ErrorRegexp = r".*: error:.*"
self.m_WarningRegexp = r".*: warning:.*"
[docs] def getCxxDir(self):
return os.path.normpath(self.m_Dir + r"\\gclang++exe")
[docs] def getCDir(self):
return os.path.normpath(self.m_Dir + r"\\clang.exe")
[docs] def getArDir(self):
return os.path.normpath(self.m_Dir + r"\\llvm-ar.exe")
[docs] def getRcDir(self):
return os.path.normpath(self.m_Dir + r"\\windres.exe")
[docs] def getMakeDir(self):
return os.path.normpath(self.m_Dir + r"\\mingw32-make.exe")
[docs] def getLinkDir(self):
return os.path.normpath(self.m_Dir + r"\\llvm-lib.exe")
[docs] def getNmDir(self):
return os.path.normpath(self.m_Dir + r"\\nm.exe")
[docs] def getObjDIr(self):
return os.path.normpath(self.m_Dir + r"\\objcopy.exe")
[docs] def getObjDumb(self):
return os.path.normpath(self.m_Dir + r"\\llvm-objdump.exe")
[docs] def getRanLib(self):
return os.path.normpath(self.m_Dir + r"\\llvm-ranlib.exe")
[docs] def getStrip(self):
return os.path.normpath(self.m_Dir + r"\\strip.exe")
@staticmethod
[docs] def getStaticLibraryWildCard():
"""
:return: The extension of the static library associate with this compiler.
:rtype: str
"""
# todo I don't know, i have to test
return "lib"
[docs]class Clang_32(Clang):
""" Default path : C:\\Program Files (x86)\\LLVM\\bin """
def __init__(self, inConfigFile, inSectionName="clang_32", inDir=r"C:\\Program Files (x86)\\LLVM\\bin"):
Clang.__init__(self, inConfigFile, inSectionName, inDir, GDeps.AdressModel.x86, Clang_32.getTypeName())
@staticmethod
[docs] def getTypeName():
return "Clang_32"
[docs]class Clang_64(Clang):
""" Default path : C:\\Program Files\\LLVM\\bin """
def __init__(self, inConfigFile, inSectionName="clang_64", inDir=r"C:\\Program Files\\LLVM\\bin"):
Clang.__init__(self, inConfigFile, inSectionName, inDir, GDeps.AdressModel.x64, Clang_64.getTypeName())
@staticmethod
[docs] def getTypeName():
return "Clang_64"