diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2023-04-21 19:42:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-21 19:42:09 +0200 |
commit | a660b3e67f32e1d1bdf612a11f3fb77a57a60928 (patch) | |
tree | 2f6c9828e6938af8f4ba587a72582733cb7c74ee | |
parent | c266b21674171dfb39d10872bec6ac493665cc5d (diff) | |
parent | 63415a419815d844149557aa16fa8a0f72b0c7e6 (diff) | |
download | ninja-a660b3e67f32e1d1bdf612a11f3fb77a57a60928.tar.gz |
Merge pull request #2290 from digit-google/use-ppoll
Enable ppoll() usage when available.
-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 |