def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and emergeSettings.getboolean( "Compile", "UseNinja", False): return "Ninja" if compiler.isMSVC2015(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 14 2015" + " Win64" if compiler.isX64( ) else "" else: return "NMake Makefiles" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: EmergeDebug.die("unknown %s compiler" % self.compiler())
def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and emergeSettings.getboolean("Compile","UseNinja", False): return "Ninja" if compiler.isMSVC2015(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 14 2015" + " Win64" if compiler.isX64() else "" else: return "NMake Makefiles" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: EmergeDebug.die("unknown %s compiler" % self.compiler())
def configureOptions( self, defines=""): """returns default configure options""" options = BuildSystemBase.configureOptions(self) ## \todo why is it required to replace \\ by / ? options += " -DCMAKE_INSTALL_PREFIX=\"%s\"" % self.mergeDestinationDir().replace( "\\", "/" ) options += " -DCMAKE_PREFIX_PATH=\"%s\"" % \ self.mergeDestinationDir().replace( "\\", "/" ) if( not self.buildType() == None ): options += " -DCMAKE_BUILD_TYPE=%s" % self.buildType() if self.buildTests: # @todo KDE4_BUILD_TESTS is only required for kde packages, how to detect this case if not self.subinfo.options.configure.testDefine == None: options += " " + self.subinfo.options.configure.testDefine + " " else: options += " -DKDE4_BUILD_TESTS=1 " if self.subinfo.options.buildTools: options += " " + self.subinfo.options.configure.toolsDefine + " " if self.subinfo.options.buildStatic and self.subinfo.options.configure.staticDefine: options += " " + self.subinfo.options.configure.staticDefine + " " if self.subinfo.options.configure.onlyBuildTargets : options += self.__onlyBuildDefines(self.subinfo.options.configure.onlyBuildTargets ) if self.subinfo.options.cmake.useCTest: options += " -DCMAKE_PROGRAM_PATH=\"%s\" " % \ ( os.path.join( self.mergeDestinationDir(), "dev-utils", "svn", "bin" ).replace( "\\", "/" ) ) if compiler.isIntel(): # this is needed because otherwise it'll detect the MSVC environment options += " -DCMAKE_CXX_COMPILER=\"%s\" " % os.path.join(os.getenv("BIN_ROOT"), os.getenv("ARCH_PATH"), "icl.exe" ).replace( "\\", "/" ) options += " -DCMAKE_C_COMPILER=\"%s\" " % os.path.join(os.getenv("BIN_ROOT"), os.getenv("ARCH_PATH"), "icl.exe" ).replace( "\\", "/" ) options += " -DCMAKE_LINKER=\"%s\" " % os.path.join(os.getenv("BIN_ROOT"), os.getenv("ARCH_PATH"), "xilink.exe" ).replace( "\\", "/" ) options += " \"%s\"" % self.configureSourceDir() return options
def getEnv( self ): out = dict( ) if compiler.isMSVC( ): compilerDirs = { "msvc2010": "VS100COMNTOOLS", "msvc2012": "VS110COMNTOOLS", "msvc2013": "VS120COMNTOOLS", "msvc2015": "VS140COMNTOOLS" } architectures = { "x86": "x86", "x64": "amd64", "x64_cross": "x86_amd64" } crossmodifier = "" if not compiler.isNative(): crossmodifier="_cross" status, result = subprocess.getstatusoutput( "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" % ( os.getenv( compilerDirs[ compiler.getCompilerName( ) ] ), architectures[ compiler.architecture( ) + crossmodifier ]) ) if status != 0: print( "Failed to setup msvc compiler", file = sys.stderr ) out = self.stringToEnv( result ) elif compiler.isIntel( ): architectures = { "x86": "ia32", "x64": "intel64" } programFiles = os.getenv( "ProgramFiles(x86)" ) or os.getenv( "ProgramFiles" ) status, result = subprocess.getstatusoutput( "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set" % ( programFiles, architectures[ compiler.architecture( ) ]) ) if status != 0: print( "Failed to setup intel compiler", file = sys.stderr ) out = self.stringToEnv( result ) elif compiler.isMinGW( ): out = { "Path": os.getenv( "Path" ) } return out
def __init__(self): BuildSystemBase.__init__(self, "qmake") self.platform = "" if compiler.isMSVC(): self.platform = "win32-%s" % self.compiler() elif compiler.isMinGW(): self.platform = "win32-g++" elif compiler.isIntel(): self.platform = "win32-icc" else: utils.die("QMakeBuildSystem: unsupported compiler platform %s" % self.compiler())
def _getmakeProgram(self): if self.supportsNinja and utils.envAsBool("EMERGE_USE_NINJA"): return "ninja" EMERGE_MAKE_PROGRAM = os.getenv( "EMERGE_MAKE_PROGRAM" ) if EMERGE_MAKE_PROGRAM and self.subinfo.options.make.supportsMultijob: utils.debug( "set custom make program: %s" % EMERGE_MAKE_PROGRAM, 1 ) return EMERGE_MAKE_PROGRAM elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: utils.die( "unknown %s compiler" % self.compiler() )
def _getmakeProgram(self): if self.supportsNinja and emergeSettings.getboolean("General","EMERGE_USE_NINJA", False): return "ninja" EMERGE_MAKE_PROGRAM = emergeSettings.get("General", "EMERGE_MAKE_PROGRAM", "" ) if EMERGE_MAKE_PROGRAM != "" and self.subinfo.options.make.supportsMultijob: utils.debug( "set custom make program: %s" % EMERGE_MAKE_PROGRAM, 1 ) return EMERGE_MAKE_PROGRAM elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: utils.die( "unknown %s compiler" % self.compiler() )
def _getmakeProgram(self): if self.supportsNinja and emergeSettings.getboolean("Compile","UseNinja", False): return "ninja" makeProgram = emergeSettings.get("Compile", "MakeProgram", "" ) if makeProgram != "" and self.subinfo.options.make.supportsMultijob: EmergeDebug.debug("set custom make program: %s" % makeProgram, 1) return makeProgram elif not self.subinfo.options.make.supportsMultijob: if "MAKE" in os.environ: del os.environ["MAKE"] if compiler.isMSVC() or compiler.isIntel() : return "nmake /NOLOGO" elif compiler.isMinGW(): return "mingw32-make" else: EmergeDebug.die("unknown %s compiler" % self.compiler())
def __init__(self): BuildSystemBase.__init__(self, "qmake") self.platform = "" if compiler.isMSVC(): if compiler.isClang(): self.platform = "win32-clang-%s" % self.compiler() else: self.platform = "win32-%s" % self.compiler() elif compiler.isMinGW(): self.platform = "win32-g++" elif compiler.isIntel(): self.platform = "win32-icc" else: EmergeDebug.die( "QMakeBuildSystem: unsupported compiler platform %s" % self.compiler())
def install(self, options=None): """implements the make step for Qt projects""" if not BuildSystemBase.install(self): return False # There is a bug in jom that parallel installation of qmake projects # does not work. So just use the usual make programs. It's hacky but # this was decided on the 2012 Windows sprint. if compiler.isMSVC() or compiler.isIntel(): installmake = "nmake /NOLOGO" elif compiler.isMinGW(): installmake = "mingw32-make" self.enterBuildDir() if options != None: command = "%s %s" % (installmake, options) else: command = "%s install" % (installmake) return self.system(command)
def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and emergeSettings.getboolean("General","EMERGE_USE_NINJA", False): return "Ninja" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: utils.die( "unknown %s compiler" % self.compiler() )
def getEnv(self): out = dict() if compiler.isMSVC(): compilerDirs = { "msvc2010": "VS100COMNTOOLS", "msvc2012": "VS110COMNTOOLS", "msvc2013": "VS120COMNTOOLS", "msvc2015": "VS140COMNTOOLS" } architectures = { "x86": "x86", "x64": "amd64", "x64_cross": "x86_amd64" } crossmodifier = "" if not compiler.isNative(): crossmodifier = "_cross" status, result = subprocess.getstatusoutput( "\"%s\\..\\..\\VC\\vcvarsall.bat\" %s > NUL && set" % (os.getenv(compilerDirs[compiler.getCompilerName()]), architectures[compiler.architecture() + crossmodifier])) if status != 0: print("Failed to setup msvc compiler", file=sys.stderr) exit(1) out = self.stringToEnv(result) elif compiler.isIntel(): architectures = {"x86": "ia32", "x64": "intel64"} programFiles = os.getenv("ProgramFiles(x86)") or os.getenv( "ProgramFiles") status, result = subprocess.getstatusoutput( "\"%s\\Intel\\Composer XE\\bin\\compilervars.bat\" %s > NUL && set" % (programFiles, architectures[compiler.architecture()])) if status != 0: print("Failed to setup intel compiler", file=sys.stderr) exit(1) out = self.stringToEnv(result) elif compiler.isMinGW(): out = {"Path": os.getenv("Path")} return out
def __makeFileGenerator(self): """return cmake related make file generator""" if self.supportsNinja and utils.envAsBool("EMERGE_USE_NINJA"): return "Ninja" if compiler.isMSVC2010(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: return "Visual Studio 10" else: return "NMake Makefiles" elif compiler.isMSVC2008(): if self.subinfo.options.cmake.useIDE or self.subinfo.options.cmake.openIDE: if self.isTargetBuild(): return "Visual Studio 9.0 Windows Mobile 6 Professional SDK (ARMV4I)" else: return "Visual Studio 9 2008" else: return "NMake Makefiles" elif compiler.isMSVC() or compiler.isIntel(): return "NMake Makefiles" elif compiler.isMinGW(): return "MinGW Makefiles" else: utils.die( "unknown %s compiler" % self.compiler() )
self.patchToApply['2.8.0'] = [('pthreads-w32-2-8-0-release-20110729.diff', 1)] self.patchToApply['2.9.1'] = [('pthreads-w32-2-9-1-release-20130901.diff', 1)] self.targetDigests['2.8.0'] = 'da8371cb20e8e238f96a1d0651212f154d84a9ac' self.targetDigests['2.9.1'] = '24d40e89c2e66a765733e8c98d6f94500343da86' self.shortDescription = 'a POSIX thread implementation for windows' self.defaultTarget = '2.9.1' def setDependencies( self ): self.buildDependencies['virtual/base'] = 'default' from Package.CMakePackageBase import * from Package.VirtualPackageBase import * class PthreadsPackage(CMakePackageBase): def __init__( self, **args ): CMakePackageBase.__init__(self) self.subinfo.options.configure.defines = " -DBUILD_TESTS=OFF" if compiler.isMSVC() or compiler.isIntel() or compiler.getMinGWVersion() == "4.4.7": class Package(PthreadsPackage): def __init__( self ): PthreadsPackage.__init__( self ) else: class Package(VirtualPackageBase): def __init__( self ): VirtualPackageBase.__init__( self )
'2.9.1'] = '24d40e89c2e66a765733e8c98d6f94500343da86' self.shortDescription = 'a POSIX thread implementation for windows' self.defaultTarget = '2.9.1' def setDependencies(self): self.buildDependencies['virtual/base'] = 'default' from Package.CMakePackageBase import * from Package.VirtualPackageBase import * class PthreadsPackage(CMakePackageBase): def __init__(self, **args): CMakePackageBase.__init__(self) self.subinfo.options.configure.defines = " -DBUILD_TESTS=OFF" if compiler.isMSVC() or compiler.isIntel() or compiler.getMinGWVersion( ) == "4.4.7": class Package(PthreadsPackage): def __init__(self): PthreadsPackage.__init__(self) else: class Package(VirtualPackageBase): def __init__(self): VirtualPackageBase.__init__(self)
def setDependencies( self ): self.dependencies['qt-libs/phonon'] = 'default' self.dependencies['binary/vlc'] = 'default' if compiler.isMSVC() or compiler.isIntel(): self.dependencies['kdesupport/kdewin'] = 'default'