diff options
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 98f7948..fd32ab1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ include(CheckSymbolExists) include(CheckIPOSupported) option(NINJA_BUILD_BINARY "Build ninja binary" ON) +option(NINJA_FORCE_PSELECT "Use pselect() even on platforms that provide ppoll()" OFF) project(ninja CXX) @@ -35,6 +36,16 @@ else() if(flag_color_diag) add_compile_options(-fdiagnostics-color) endif() + + if(NOT NINJA_FORCE_PSELECT) + # Check whether ppoll() is usable on the target platform. + # Set -DUSE_PPOLL=1 if this is the case. + include(CheckSymbolExists) + check_symbol_exists(ppoll poll.h HAVE_PPOLL) + if(HAVE_PPOLL) + add_compile_definitions(USE_PPOLL=1) + endif() + endif() endif() # --- optional re2c |