Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tools/donate-cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def hasInclude(path, includes):
return False


def scanPackage(workPath, cppcheck, jobs):
def scanPackage(workPath, cppcheckPath, jobs):
print('Analyze..')
os.chdir(workPath)
libraries = ' --library=posix'
Expand All @@ -234,12 +234,13 @@ def scanPackage(workPath, cppcheck, jobs):
libraries += ' --library=wxwidgets'
if hasInclude('temp', ['<zlib.h>']):
libraries += ' --library=zlib'
# if hasInclude('temp', ['<boost/']):
# TODO: enable boost library configuration detection after release of Cppcheck 1.87
# if os.path.exists(cppcheckPath + '/cfg/boost.cfg') and hasInclude('temp', ['<boost/']):
# libraries += ' --library=boost'

# Reference for GNU C: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
options = jobs + libraries + ' --library=gnu -D__GNUC__ --check-library --inconclusive --enable=style,information --platform=unix64 --template=daca2 -rp=temp temp'
cmd = 'nice ' + cppcheck + ' ' + options
cmd = 'nice ' + cppcheckPath + '/cppcheck' + ' ' + options
print(cmd)
startTime = time.time()
p = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Expand Down Expand Up @@ -454,10 +455,10 @@ def uploadInfo(package, info_output, server_address):
head_info_msg = ''
for ver in cppcheckVersions:
if ver == 'head':
cppcheck = 'cppcheck/cppcheck'
current_cppcheck_dir = 'cppcheck'
else:
cppcheck = ver + '/cppcheck'
c, errout, info, t, cppcheck_options = scanPackage(workpath, cppcheck, jobs)
current_cppcheck_dir = ver
c, errout, info, t, cppcheck_options = scanPackage(workpath, current_cppcheck_dir, jobs)
if c < 0:
crash = True
count += ' Crash!'
Expand Down