donate_cpu: Refactor library checks (#1675)

This commit is contained in:
rikardfalkeborn 2019-02-19 11:50:39 +01:00 committed by amai2012
parent dfaf75db54
commit 1c1778e4df
1 changed files with 14 additions and 17 deletions

View File

@ -37,7 +37,7 @@ import platform
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ # Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
# changes) # changes)
CLIENT_VERSION = "1.1.3" CLIENT_VERSION = "1.1.4"
def checkRequirements(): def checkRequirements():
@ -228,22 +228,19 @@ def scanPackage(workPath, cppcheckPath, jobs, fast):
print('Analyze..') print('Analyze..')
os.chdir(workPath) os.chdir(workPath)
libraries = ' --library=posix --library=gnu' libraries = ' --library=posix --library=gnu'
if hasInclude('temp', ['<gtk/gtk.h>', '<glib.h>', '<glib/']):
libraries += ' --library=gtk' libraryIncludes = {'boost': ['<boost/'],
if hasInclude('temp', ['<X11/', '<Xm/']): 'gtk': ['<gtk/gtk.h>', '<glib.h>', '<glib/'],
libraries += ' --library=motif' 'motif': ['<X11/', '<Xm/'],
if os.path.exists(cppcheckPath + '/cfg/python.cfg') and hasInclude('temp', ['<Python.h>']): 'python': ['<Python.h>'],
libraries += ' --library=python' 'qt': ['<QApplication>', '<QString>', '<QWidget>', '<QtWidgets>', '<QtGui'],
if hasInclude('temp', ['<QApplication>', '<QString>', '<QWidget>', '<QtWidgets>', '<QtGui']): 'sdl': ['<SDL.h>'],
libraries += ' --library=qt' 'wxwidgets': ['<wx/', '"wx/'],
if hasInclude('temp', ['<wx/', '"wx/']): 'zlib': ['<zlib.h>'],
libraries += ' --library=wxwidgets' }
if hasInclude('temp', ['<zlib.h>']): for library, includes in libraryIncludes.items():
libraries += ' --library=zlib' if os.path.exists(os.path.join(cppcheckPath, 'cfg', library + '.cfg')) and hasInclude('temp', includes):
if os.path.exists(cppcheckPath + '/cfg/boost.cfg') and hasInclude('temp', ['<boost/']): libraries += ' --library=' + library
libraries += ' --library=boost'
if hasInclude('temp', ['<SDL.h>']):
libraries += ' --library=sdl'
# Reference for GNU C: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html # Reference for GNU C: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
options = jobs + libraries + ' -D__GNUC__ --check-library --inconclusive --enable=style,information --platform=unix64 --template=daca2 -rp=temp temp' options = jobs + libraries + ' -D__GNUC__ --check-library --inconclusive --enable=style,information --platform=unix64 --template=daca2 -rp=temp temp'