2020-04-06 15:52:53 +02:00
from conans import ConanFile , AutoToolsBuildEnvironment , tools
import os
2022-05-16 10:15:24 +02:00
import shutil
2020-04-06 15:52:53 +02:00
class TccConan ( ConanFile ) :
name = " tcc "
2022-05-16 09:47:00 +02:00
revision = " 62c30a4a "
version = " 0.9.27+ %s " % revision if revision else " 0.9.27 "
2020-04-06 15:52:53 +02:00
license = " GNU Lesser General Public License "
author = " Eyck Jentzsch <eyck@minres.com> "
url = " https://github.com/Minres/conan-recipes/tree/master/TCC "
description = " TinyCC (aka TCC) is a small but hyper fast C compiler. Unlike other C compilers, it is meant to be self-relying: you do not need an external assembler or linker because TCC does that for you. "
topics = ( " compiler " , " c " )
settings = " os " , " compiler " , " build_type " , " arch "
default_options = { }
source_tar = " http://download.savannah.gnu.org/releases/tinycc/tcc- %s .tar.bz2 " % version
2022-05-16 09:47:00 +02:00
git_repo = " git://repo.or.cz/tinycc.git "
2020-04-06 15:52:53 +02:00
#generators = "cmake"
sub_folder = " tcc- %s " % version
exports_sources = " tcc- %s /* " % version
def source ( self ) :
2022-05-16 10:15:24 +02:00
if self . revision :
self . output . info ( " Cloning from %s " % self . git_repo )
2022-05-16 09:47:00 +02:00
git = tools . Git ( folder = self . sub_folder )
2022-05-16 10:15:24 +02:00
if os . path . exists ( self . sub_folder ) :
shutil . rmtree ( self . sub_folder )
git . clone ( self . git_repo )
git . checkout ( self . revision )
2022-05-16 09:47:00 +02:00
else :
2022-05-16 10:15:24 +02:00
self . output . info ( " Downloading %s " % self . source_tar )
2022-05-16 09:47:00 +02:00
tools . download ( self . source_tar , " tcc.tar.bz2 " )
tools . unzip ( " tcc.tar.bz2 " )
os . remove ( " tcc.tar.bz2 " )
2020-04-06 15:52:53 +02:00
def configure ( self ) :
del self . settings . compiler . libcxx
def build ( self ) :
autotools = AutoToolsBuildEnvironment ( self )
autotools . fpic = True
with tools . chdir ( " %s / %s " % ( self . source_folder , self . sub_folder ) ) :
autotools . configure ( )
autotools . make ( )
autotools . make ( target = " install " )
def package ( self ) :
pass
def package_info ( self ) :
self . cpp_info . libs = [ " tcc " ]