|
33 | 33 | #include "suppressions.h" |
34 | 34 | #include "utils.h" |
35 | 35 |
|
36 | | -#if defined(THREADING_MODEL_THREAD) |
| 36 | +#if defined(HAS_THREADING_MODEL_THREAD) |
37 | 37 | #include "threadexecutor.h" |
38 | | -#elif defined(THREADING_MODEL_FORK) |
| 38 | +#endif |
| 39 | +#if defined(HAS_THREADING_MODEL_FORK) |
39 | 40 | #include "processexecutor.h" |
40 | 41 | #endif |
41 | 42 |
|
@@ -271,18 +272,24 @@ int CppCheckExecutor::check_internal(const Settings& settings) const |
271 | 272 | cppcheck.settings() = settings; // this is a copy |
272 | 273 | auto& suppressions = cppcheck.settings().supprs.nomsg; |
273 | 274 |
|
274 | | - unsigned int returnValue; |
| 275 | + unsigned int returnValue = 0; |
275 | 276 | if (settings.useSingleJob()) { |
276 | 277 | // Single process |
277 | 278 | SingleExecutor executor(cppcheck, mFiles, mFileSettings, settings, suppressions, stdLogger); |
278 | 279 | returnValue = executor.check(); |
279 | 280 | } else { |
280 | | -#if defined(THREADING_MODEL_THREAD) |
281 | | - ThreadExecutor executor(mFiles, mFileSettings, settings, suppressions, stdLogger, CppCheckExecutor::executeCommand); |
282 | | -#elif defined(THREADING_MODEL_FORK) |
283 | | - ProcessExecutor executor(mFiles, mFileSettings, settings, suppressions, stdLogger, CppCheckExecutor::executeCommand); |
| 281 | +#if defined(HAS_THREADING_MODEL_THREAD) |
| 282 | + if (settings.executor == Settings::ExecutorType::Thread) { |
| 283 | + ThreadExecutor executor(mFiles, mFileSettings, settings, suppressions, stdLogger, CppCheckExecutor::executeCommand); |
| 284 | + returnValue = executor.check(); |
| 285 | + } |
| 286 | +#endif |
| 287 | +#if defined(HAS_THREADING_MODEL_FORK) |
| 288 | + if (settings.executor == Settings::ExecutorType::Process) { |
| 289 | + ProcessExecutor executor(mFiles, mFileSettings, settings, suppressions, stdLogger, CppCheckExecutor::executeCommand); |
| 290 | + returnValue = executor.check(); |
| 291 | + } |
284 | 292 | #endif |
285 | | - returnValue = executor.check(); |
286 | 293 | } |
287 | 294 |
|
288 | 295 | cppcheck.analyseWholeProgram(settings.buildDir, mFiles, mFileSettings); |
|
0 commit comments