Mercurial > codeOptimizer
diff codeOptimizer.py @ 2:10f1d7de9bc3
New module for reading configurations.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Sun, 16 Sep 2012 21:29:22 +0200 |
| parents | a1224150b8f6 |
| children | f65c2d63ab66 |
line wrap: on
line diff
--- a/codeOptimizer.py Sun Sep 16 10:35:39 2012 +0200 +++ b/codeOptimizer.py Sun Sep 16 21:29:22 2012 +0200 @@ -4,6 +4,7 @@ from Compilable import Compilable from DepGraph import DepGraph +from Options import Config @@ -19,18 +20,19 @@ return True return False - -infiles = sys.argv[1:] +try: + options = Config(sys.argv[1]) +except: + print sys.argv[1] + ' is not a valid xml file' +infiles = sys.argv[2:] files = {} unknown = [] -flags = '-DHAS_BOOST -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_XML_LIB -DQT_SQL_LIB -O3 -Wall -I/opt/local/include -I/Users/bfg/QtSDK/Desktop/Qt/4.8.1/gcc/include -F/Users/bfg/QtSDK/Desktop/Qt/4.8.1/gcc/lib -I/Users/bfg/QtSDK/Desktop/Qt/4.8.1/gcc/include/QtOpenGL -I/Users/bfg/QtSDK/Desktop/Qt/4.8.1/gcc/include/QtXml -I/Users/bfg/QtSDK/Desktop/Qt/4.8.1/gcc/include/QtSql -I/Users/bfg/projects/dedupe' - for file in infiles: if isHppfile(file) or isCppfile(file): c = Compilable(file) - c.setFlags(flags) + c.setFlags(options.getCxxflags(file)) files[file] = c else: unknown.append(file) @@ -52,7 +54,7 @@ for file in files: if not file.worksWithoutModifications(): print file.path - raise SystemExit(str.join(file.path) + " does not compile at all") + raise SystemExit(file.path + " does not compile at all") for file in files: removable = file.removeRemovableIncludes()
