예제 #1
0
    def initBuildObjects(self,
                         lstExtraCPPs=None,
                         lstDepends=None,
                         lstDependPaths=None,
                         pthSrcDir=None):
        if not pthSrcDir:
            pthSrcSearch=[join(self.dctFwVars['pthProjectDir'], 'src', '*.cpp'),\
                          join(self.dctFwVars['pthProjectDir'], 'src',  '*.cxx'),\
                          join(self.dctFwVars['pthProjectDir'], 'src', '*.c')]
        else:
            pthSrcSearch=[join(pthSrcDir, '*.cpp'),\
                          join(pthSrcDir, '*.cxx'),\
                          join(pthSrcDir, '*.c')]
            setupIncludePaths(self.oEnv, pthSrcDir)

        self.lstCxxFiles = []
        for sp in pthSrcSearch:
            self.lstCxxFiles += globtree(sp)
        if lstExtraCPPs: self.lstCxxFiles += lstExtraCPPs

        self.oObjectFiles = constructObjects(self.oEnv,
                                             self.dctFwVars['pthProjectDir'],
                                             self.lstCxxFiles)

        # Special SCons handling for MSVC
        specialMSVCHandler(self.oEnv)

        sLibraryName = self.dctFwVars['sProjectName']
        if self.dctFwVars['libtype'] == 'shared':
            #            createDefFile( self.dctFwVars['pthDevLabRoot' ],\
            #                           self.dctFwVars['pthProjectRoot'],\
            #                           self.dctFwVars['pthBuildRoot'  ],\
            #                           self.dctFwVars['sProjectName'  ] )
            if (sys.platform == 'darwin'):
                if 'EXTRALIBOBJS' in self.dctFwVars:
                    self.oObjectFiles += self.dctFwVars['EXTRALIBOBJS']
        elif self.dctFwVars['libtype'] == 'static':
            if (sys.platform != 'win32'):
                if 'EXTRALIBOBJS' in self.dctFwVars:
                    self.oObjectFiles += self.dctFwVars['EXTRALIBOBJS']
        elif self.dctFwVars['libtype'] == 'exe':
            if self.dctFwVars.has_key('sProgramName'):
                sLibraryName = self.dctFwVars['sProgramName']
            else:
                sLibraryName = self.dctFwVars['sProjectName']

        # Create Library object and get the SCons library object from it
        oLibraryObject = fwLibrary(self.oEnv, sLibraryName, self.oObjectFiles)
        oLib = oLibraryObject.getLibrary()

        return oLib
예제 #2
0
    def initBuildObjects(self, lstExtraCPPs=None, lstDepends=None, lstDependPaths=None, pthSrcDir=None):
        if not pthSrcDir:
            pthSrcSearch = [
                join(self.dctFwVars["pthProjectDir"], "src", "*.cpp"),
                join(self.dctFwVars["pthProjectDir"], "src", "*.cxx"),
                join(self.dctFwVars["pthProjectDir"], "src", "*.c"),
            ]
        else:
            pthSrcSearch = [join(pthSrcDir, "*.cpp"), join(pthSrcDir, "*.cxx"), join(pthSrcDir, "*.c")]
            setupIncludePaths(self.oEnv, pthSrcDir)

        self.lstCxxFiles = []
        for sp in pthSrcSearch:
            self.lstCxxFiles += globtree(sp)
        if lstExtraCPPs:
            self.lstCxxFiles += lstExtraCPPs

        self.oObjectFiles = constructObjects(self.oEnv, self.dctFwVars["pthProjectDir"], self.lstCxxFiles)

        # Special SCons handling for MSVC
        specialMSVCHandler(self.oEnv)

        sLibraryName = self.dctFwVars["sProjectName"]
        if self.dctFwVars["libtype"] == "shared":
            createDefFile(
                self.dctFwVars["pthDevLabRoot"],
                self.dctFwVars["pthProjectRoot"],
                self.dctFwVars["pthBuildRoot"],
                self.dctFwVars["sProjectName"],
            )
            if sys.platform == "darwin":
                if "EXTRALIBOBJS" in self.dctFwVars:
                    self.oObjectFiles += self.dctFwVars["EXTRALIBOBJS"]
        elif self.dctFwVars["libtype"] == "static":
            if sys.platform != "win32":
                if "EXTRALIBOBJS" in self.dctFwVars:
                    self.oObjectFiles += self.dctFwVars["EXTRALIBOBJS"]
        elif self.dctFwVars["libtype"] == "exe":
            if self.dctFwVars.has_key("sProgramName"):
                sLibraryName = self.dctFwVars["sProgramName"]
            else:
                sLibraryName = self.dctFwVars["sProjectName"]

        # Create Library object and get the SCons library object from it
        oLibraryObject = fwLibrary(self.oEnv, sLibraryName, self.oObjectFiles)
        oLib = oLibraryObject.getLibrary()

        return oLib
예제 #3
0
    def initBuildObjects(self, lstExtraCPPs = None, lstDepends = None, lstDependPaths = None, pthSrcDir=None):
        if not pthSrcDir:
            pthSrcSearch=[join(self.dctFwVars['pthProjectDir'], 'src', '*.cpp'),\
                          join(self.dctFwVars['pthProjectDir'], 'src',  '*.cxx'),\
                          join(self.dctFwVars['pthProjectDir'], 'src', '*.c')]
        else:
            pthSrcSearch=[join(pthSrcDir, '*.cpp'),\
                          join(pthSrcDir, '*.cxx'),\
                          join(pthSrcDir, '*.c')]
            setupIncludePaths(self.oEnv, pthSrcDir)


        self.lstCxxFiles = []
        for sp in pthSrcSearch:
            self.lstCxxFiles += globtree(sp)
        if lstExtraCPPs: self.lstCxxFiles += lstExtraCPPs

        self.oObjectFiles = constructObjects( self.oEnv,
                                              self.dctFwVars['pthProjectDir'],
                                              self.lstCxxFiles )

        # Special SCons handling for MSVC
        specialMSVCHandler(self.oEnv)

        sLibraryName = self.dctFwVars['sProjectName']
        if self.dctFwVars['libtype'] == 'shared':
            createDefFile( self.dctFwVars['pthDevLabRoot' ],\
                           self.dctFwVars['pthProjectRoot'],\
                           self.dctFwVars['pthBuildRoot'  ],\
                           self.dctFwVars['sProjectName'  ] )
            if (sys.platform == 'darwin'):
                if 'EXTRALIBOBJS' in self.dctFwVars:
                    self.oObjectFiles += self.dctFwVars['EXTRALIBOBJS']
        elif self.dctFwVars['libtype'] == 'static':
            if (sys.platform != 'win32'):
                if 'EXTRALIBOBJS' in self.dctFwVars:
                    self.oObjectFiles += self.dctFwVars['EXTRALIBOBJS']
        elif self.dctFwVars['libtype'] == 'exe':
            if self.dctFwVars.has_key('sProgramName'): sLibraryName = self.dctFwVars['sProgramName']
            else: sLibraryName = self.dctFwVars['sProjectName']

        # Create Library object and get the SCons library object from it
        oLibraryObject = fwLibrary(self.oEnv, sLibraryName, self.oObjectFiles)
        oLib = oLibraryObject.getLibrary()

        return oLib
예제 #4
0
    def initMultipassBuildObjects(self,
                                  lstExtraCPPs=None,
                                  lstExcludes=None,
                                  pthSrcDir=None):
        if pthSrcDir:
            pthSavedProjectDir = self.dctFwVars['pthProjectDir']
            self.dctFwVars['pthProjectDir'] = pthSrcDir
            setupIncludePaths(self.oEnv, pthSrcDir)
        else:
            pthSavedProjectDir = None

        # if this is true, currently this means that we're building the d version of the static lib
        if (pthSavedProjectDir):
            sCPPFile = self.dctFwVars['sProjectName'][:-1] + '.cpp'
            sOptCPPFile = self.dctFwVars['sProjectName'][:-1] + '_opt.cpp'
            pthOptHFile = join('include',
                               self.dctFwVars['sProjectName'][:-1] + '_opt.h')
            pthOptCPPFile = join(
                'src', self.dctFwVars['sProjectName'][:-1] + '_opt.cpp')
            pthBuildHFile = join(self.dctFwVars['pthBuildRoot'], 'include',
                                 self.dctFwVars['sProjectName'][:-1] + '.h')
        else:
            sCPPFile = self.dctFwVars['sProjectName'] + '.cpp'
            sOptCPPFile = self.dctFwVars['sProjectName'] + '_opt.cpp'
            pthOptHFile = join('include',
                               self.dctFwVars['sProjectName'] + '_opt.h')
            pthOptCPPFile = join('src',
                                 self.dctFwVars['sProjectName'] + '_opt.cpp')
            pthBuildHFile = join(self.dctFwVars['pthBuildRoot'], 'include',
                                 self.dctFwVars['sProjectName'] + '.h')

        # need to create DEF file here everytime, even if its a static library
#        if (pthSavedProjectDir):
#            createDefFile( self.dctFwVars['pthDevLabRoot' ],\
#                           self.dctFwVars['pthProjectRoot'],\
#                           self.dctFwVars['pthBuildRoot'  ],\
#                           self.dctFwVars['sProjectName'  ][:-1] )
#        else:
#            createDefFile( self.dctFwVars['pthDevLabRoot' ],\
#                           self.dctFwVars['pthProjectRoot'],\
#                           self.dctFwVars['pthBuildRoot'  ],\
#                           self.dctFwVars['sProjectName'  ] )

# BUGBUG: <one last hack; can't get rid of this for a bit>
        if (self.dctFwVars['toolset']
                == 'suncc') and (self.dctFwVars['sProjectName'] == 'fwImage'):
            pthBuildHFile = appendToFilename(pthBuildHFile, '_sol')
        # </one last hack>

        dctFunctions = constructMultipassCPP( self.dctFwVars['pthProjectDir'],          \
                               self.dctFwVars['sProjectName'],           \
                               pthOptHFile, \
                               pthOptCPPFile, \
                               pthBuildHFile )

        self.lstCxxFiles = globtree(
            join(self.dctFwVars['pthProjectDir'], 'src', '*.cpp'))
        self.lstCxxFiles += globtree(
            join(self.dctFwVars['pthProjectDir'], 'src', '*.cxx'))
        self.lstCxxFiles += globtree(
            join(self.dctFwVars['pthProjectDir'], 'src', '*.c'))
        if lstExtraCPPs: self.lstCxxFiles += lstExtraCPPs

        if not lstExcludes: lstExcludes = []
        lstExcludes = lstExcludes + [sOptCPPFile, sCPPFile]
        if lstExtraCPPs:
            lstExcludes = lstExcludes + [basename(cpp) for cpp in lstExtraCPPs]

        self.oObjectFiles = constructMultipassObjects( self.oEnv,                       \
                                                       self.dctFwVars['pthProjectDir'],\
                                                       self.lstCxxFiles )

        # Special SCons handling for MSVC
        specialMSVCHandler(self.oEnv)

        # Create Library object and get the SCons library object from it
        oLibraryObject = fwLibrary(self.oEnv, self.dctFwVars['sProjectName'],
                                   self.oObjectFiles)
        oLib = oLibraryObject.getLibrary()

        if pthSavedProjectDir:
            self.dctFwVars['pthProjectDir'] = pthSavedProjectDir
        return oLib
예제 #5
0
    def initMultipassBuildObjects(self, lstExtraCPPs=None, lstExcludes=None, pthSrcDir=None):
        if pthSrcDir:
            pthSavedProjectDir = self.dctFwVars["pthProjectDir"]
            self.dctFwVars["pthProjectDir"] = pthSrcDir
            setupIncludePaths(self.oEnv, pthSrcDir)
        else:
            pthSavedProjectDir = None

        # if this is true, currently this means that we're building the d version of the static lib
        if pthSavedProjectDir:
            sCPPFile = self.dctFwVars["sProjectName"][:-1] + ".cpp"
            sOptCPPFile = self.dctFwVars["sProjectName"][:-1] + "_opt.cpp"
            pthOptHFile = join("include", self.dctFwVars["sProjectName"][:-1] + "_opt.h")
            pthOptCPPFile = join("src", self.dctFwVars["sProjectName"][:-1] + "_opt.cpp")
            pthBuildHFile = join(self.dctFwVars["pthBuildRoot"], "include", self.dctFwVars["sProjectName"][:-1] + ".h")
        else:
            sCPPFile = self.dctFwVars["sProjectName"] + ".cpp"
            sOptCPPFile = self.dctFwVars["sProjectName"] + "_opt.cpp"
            pthOptHFile = join("include", self.dctFwVars["sProjectName"] + "_opt.h")
            pthOptCPPFile = join("src", self.dctFwVars["sProjectName"] + "_opt.cpp")
            pthBuildHFile = join(self.dctFwVars["pthBuildRoot"], "include", self.dctFwVars["sProjectName"] + ".h")

        # need to create DEF file here everytime, even if its a static library
        if pthSavedProjectDir:
            createDefFile(
                self.dctFwVars["pthDevLabRoot"],
                self.dctFwVars["pthProjectRoot"],
                self.dctFwVars["pthBuildRoot"],
                self.dctFwVars["sProjectName"][:-1],
            )
        else:
            createDefFile(
                self.dctFwVars["pthDevLabRoot"],
                self.dctFwVars["pthProjectRoot"],
                self.dctFwVars["pthBuildRoot"],
                self.dctFwVars["sProjectName"],
            )

        # BUGBUG: <one last hack; can't get rid of this for a bit>
        if (self.dctFwVars["toolset"] == "suncc") and (self.dctFwVars["sProjectName"] == "fwImage"):
            pthBuildHFile = appendToFilename(pthBuildHFile, "_sol")
            # </one last hack>

        dctFunctions = constructMultipassCPP(
            self.dctFwVars["pthProjectDir"], self.dctFwVars["sProjectName"], pthOptHFile, pthOptCPPFile, pthBuildHFile
        )

        self.lstCxxFiles = globtree(join(self.dctFwVars["pthProjectDir"], "src", "*.cpp"))
        self.lstCxxFiles += globtree(join(self.dctFwVars["pthProjectDir"], "src", "*.cxx"))
        self.lstCxxFiles += globtree(join(self.dctFwVars["pthProjectDir"], "src", "*.c"))
        if lstExtraCPPs:
            self.lstCxxFiles += lstExtraCPPs

        if not lstExcludes:
            lstExcludes = []
        lstExcludes = lstExcludes + [sOptCPPFile, sCPPFile]
        if lstExtraCPPs:
            lstExcludes = lstExcludes + [basename(cpp) for cpp in lstExtraCPPs]

        self.oObjectFiles = constructMultipassObjects(self.oEnv, self.dctFwVars["pthProjectDir"], self.lstCxxFiles)

        # Special SCons handling for MSVC
        specialMSVCHandler(self.oEnv)

        # Create Library object and get the SCons library object from it
        oLibraryObject = fwLibrary(self.oEnv, self.dctFwVars["sProjectName"], self.oObjectFiles)
        oLib = oLibraryObject.getLibrary()

        if pthSavedProjectDir:
            self.dctFwVars["pthProjectDir"] = pthSavedProjectDir
        return oLib
예제 #6
0
    def initMultipassBuildObjects(self, lstExtraCPPs = None, lstExcludes = None, pthSrcDir=None):
        if pthSrcDir:
            pthSavedProjectDir = self.dctFwVars['pthProjectDir']
            self.dctFwVars['pthProjectDir'] = pthSrcDir
            setupIncludePaths(self.oEnv, pthSrcDir)
        else:
            pthSavedProjectDir = None

        # if this is true, currently this means that we're building the d version of the static lib
        if (pthSavedProjectDir):
            sCPPFile      = self.dctFwVars['sProjectName'][:-1]+'.cpp'
            sOptCPPFile   = self.dctFwVars['sProjectName'][:-1]+'_opt.cpp'
            pthOptHFile   = join('include', self.dctFwVars['sProjectName'][:-1]+'_opt.h'  )
            pthOptCPPFile = join('src',     self.dctFwVars['sProjectName'][:-1]+'_opt.cpp')
            pthBuildHFile = join(self.dctFwVars['pthBuildRoot'], 'include', self.dctFwVars['sProjectName'][:-1]+'.h')
        else:
            sCPPFile      = self.dctFwVars['sProjectName']+'.cpp'
            sOptCPPFile   = self.dctFwVars['sProjectName']+'_opt.cpp'
            pthOptHFile   = join('include', self.dctFwVars['sProjectName']+'_opt.h'  )
            pthOptCPPFile = join('src',     self.dctFwVars['sProjectName']+'_opt.cpp')
            pthBuildHFile = join(self.dctFwVars['pthBuildRoot'], 'include', self.dctFwVars['sProjectName']+'.h')


        # need to create DEF file here everytime, even if its a static library
        if (pthSavedProjectDir):
            createDefFile( self.dctFwVars['pthDevLabRoot' ],\
                           self.dctFwVars['pthProjectRoot'],\
                           self.dctFwVars['pthBuildRoot'  ],\
                           self.dctFwVars['sProjectName'  ][:-1] )
        else:
            createDefFile( self.dctFwVars['pthDevLabRoot' ],\
                           self.dctFwVars['pthProjectRoot'],\
                           self.dctFwVars['pthBuildRoot'  ],\
                           self.dctFwVars['sProjectName'  ] )


        # BUGBUG: <one last hack; can't get rid of this for a bit>
        if (self.dctFwVars['toolset'] == 'suncc') and (self.dctFwVars['sProjectName'] == 'fwImage'):
		pthBuildHFile = appendToFilename(pthBuildHFile, '_sol')
        # </one last hack>

        dctFunctions = constructMultipassCPP( self.dctFwVars['pthProjectDir'],          \
                               self.dctFwVars['sProjectName'],           \
                               pthOptHFile, \
                               pthOptCPPFile, \
                               pthBuildHFile )

        self.lstCxxFiles  = globtree( join(self.dctFwVars['pthProjectDir'], 'src', '*.cpp') )
        self.lstCxxFiles += globtree( join(self.dctFwVars['pthProjectDir'], 'src', '*.cxx') )
        self.lstCxxFiles += globtree( join(self.dctFwVars['pthProjectDir'], 'src', '*.c') )
        if lstExtraCPPs: self.lstCxxFiles += lstExtraCPPs

        if not lstExcludes: lstExcludes = []
        lstExcludes = lstExcludes + [ sOptCPPFile, sCPPFile ]
        if lstExtraCPPs:    lstExcludes = lstExcludes + [basename(cpp) for cpp in lstExtraCPPs]

        self.oObjectFiles = constructMultipassObjects( self.oEnv,                       \
                                                       self.dctFwVars['pthProjectDir'],\
                                                       self.lstCxxFiles )

        # Special SCons handling for MSVC
        specialMSVCHandler(self.oEnv)

        # Create Library object and get the SCons library object from it
        oLibraryObject = fwLibrary(self.oEnv, self.dctFwVars['sProjectName'], self.oObjectFiles)
        oLib = oLibraryObject.getLibrary()

        if pthSavedProjectDir: self.dctFwVars['pthProjectDir'] = pthSavedProjectDir
        return oLib