Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions cli/processexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "processexecutor.h"

#if !defined(WIN32) && !defined(__MINGW32__)
#if !defined(DISALLOW_PROCESS_EXECUTOR) && !defined(WIN32) && !defined(__MINGW32__)

#include "cppcheck.h"
#include "errorlogger.h"
Expand Down Expand Up @@ -471,4 +471,4 @@ void ProcessExecutor::reportInternalChildErr(const std::string &childname, const
mErrorLogger.reportErr(errmsg);
}

#endif // !WIN32
#endif // !DISALLOW_PROCESS_EXECUTOR && !WIN32 && !__MINGW32__
4 changes: 4 additions & 0 deletions cli/threadexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "threadexecutor.h"

#if !defined(DISALLOW_THREAD_EXECUTOR)

#include "config.h"
#include "cppcheck.h"
#include "errorlogger.h"
Expand Down Expand Up @@ -219,3 +221,5 @@ unsigned int ThreadExecutor::check()

return result;
}

#endif // !DISALLOW_THREAD_EXECUTOR
4 changes: 4 additions & 0 deletions cmake/compilerDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ if(DISALLOW_THREAD_EXECUTOR)
add_definitions(-DDISALLOW_THREAD_EXECUTOR)
endif()

if(DISALLOW_PROCESS_EXECUTOR)
add_definitions(-DDISALLOW_PROCESS_EXECUTOR)
endif()

if(MSVC AND DISABLE_CRTDBG_MAP_ALLOC)
add_definitions(-DDISABLE_CRTDBG_MAP_ALLOC)
endif()
Expand Down
4 changes: 4 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ option(DISALLOW_THREAD_EXECUTOR "Disallow usage of ThreadExecutor for -j"
if(DISALLOW_THREAD_EXECUTOR AND WIN32)
message(FATAL_ERROR "Cannot disable usage of ThreadExecutor on Windows as no other executor implementation is currently available")
endif()
option(DISALLOW_PROCESS_EXECUTOR "Disallow usage of ProcessExecutor for -j" OFF)
if(DISALLOW_THREAD_EXECUTOR AND DISALLOW_PROCESS_EXECUTOR)
message(FATAL_ERROR "Cannot disable both ThreadExecutor and ProcessExecutor")
endif()
set(USE_BOOST "Auto" CACHE STRING "Usage of Boost")
set_property(CACHE USE_BOOST PROPERTY STRINGS Auto Off On)
option(USE_BOOST_INT128 "Usage of Boost.Multiprecision 128-bit integer for Mathlib" OFF)
Expand Down
1 change: 1 addition & 0 deletions cmake/printInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if(HAVE_RULES)
endif()
message(STATUS)
message(STATUS "DISALLOW_THREAD_EXECUTOR = ${DISALLOW_THREAD_EXECUTOR}")
message(STATUS "DISALLOW_PROCESS_EXECUTOR = ${DISALLOW_PROCESS_EXECUTOR}")
message(STATUS "CMAKE_THREAD_LIBS_INIT = ${CMAKE_THREAD_LIBS_INIT}")
message(STATUS)
message(STATUS "USE_BUNDLED_TINYXML2 = ${USE_BUNDLED_TINYXML2}")
Expand Down
6 changes: 5 additions & 1 deletion lib/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,16 @@ static const std::string emptyString;
#define HAS_THREADING_MODEL_THREAD
#define STDCALL __stdcall
#elif ((defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)) || defined(__CPPCHECK__)
#if !defined(DISALLOW_PROCESS_EXECUTOR)
#define HAS_THREADING_MODEL_FORK
#endif
#if !defined(DISALLOW_THREAD_EXECUTOR)
#define HAS_THREADING_MODEL_THREAD
#endif
#define STDCALL
#else
#endif

#if !defined(HAS_THREADING_MODEL_FORK) && !defined(HAS_THREADING_MODEL_THREAD)
#error "No threading model defined"
#endif

Expand Down
Loading