summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-26 13:26:00 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-27 13:32:32 (GMT)
commit1902e39746ba2aaaa3ef1918e3b14d96023966df (patch)
tree488bc05413bd3d0d649d5e5d0cffb3ccdbab8013 /Source
parent40bbe50e23c06232ccf1c49589dde5dd84e1ac31 (diff)
downloadCMake-1902e39746ba2aaaa3ef1918e3b14d96023966df.zip
CMake-1902e39746ba2aaaa3ef1918e3b14d96023966df.tar.gz
CMake-1902e39746ba2aaaa3ef1918e3b14d96023966df.tar.bz2
cmAffinity: Add include for CPU_ZERO on Alpine Linux
The definition of `CPU_ZERO` requires `<string.h>` to be included explicitly for `memset`. Since IWYU does not agree on other Linux platforms, use a pragma to silence the warning. Fixes: #19643
Diffstat (limited to 'Source')
-rw-r--r--Source/cmAffinity.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/cmAffinity.cxx b/Source/cmAffinity.cxx
index 588b2f2..09b0298 100644
--- a/Source/cmAffinity.cxx
+++ b/Source/cmAffinity.cxx
@@ -12,6 +12,8 @@
# define CM_HAVE_CPU_AFFINITY
# include <pthread.h>
# include <sched.h>
+// On some platforms CPU_ZERO needs memset but sched.h forgets string.h
+# include <string.h> // IWYU pragma: keep
# if defined(__FreeBSD__)
# include <pthread_np.h>
# include <sys/cpuset.h>