summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Kubo da Costa <rakuco@FreeBSD.org>2016-07-15 10:46:53 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-15 13:50:59 (GMT)
commit5ec17e610609b8ca80cf8ce4f33f8c03ea48a090 (patch)
tree918a89e8f1611969dac16646e6c78502aa93e2a0
parentc8e59d2dfa7cc716d11b9e32fdc6f2302e4cbe69 (diff)
downloadCMake-5ec17e610609b8ca80cf8ce4f33f8c03ea48a090.zip
CMake-5ec17e610609b8ca80cf8ce4f33f8c03ea48a090.tar.gz
CMake-5ec17e610609b8ca80cf8ce4f33f8c03ea48a090.tar.bz2
Ninja: Generalize check for sysconf(3) call
Use `sysconf(_SC_ARG_MAX)` wherever `_SC_ARG_MAX` is available instead of hard-coding an incomplete list of operating systems that implement it. In particular, it is available on BSD platforms that were not previously listed.
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 81a1618..1e83722 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -374,7 +374,7 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
#ifdef _WIN32
8000,
#endif
-#if defined(__APPLE__) || defined(__HAIKU__) || defined(__linux)
+#if defined(_SC_ARG_MAX)
// for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
((int)sysconf(_SC_ARG_MAX)) - 1000,
#endif