Commit f9644a2d ("cmGlobalNinjaGenerator: Clarify logic for forcing use
of response files") started considering that negative command line
length values meant forcing the use of response files.
cmNinjaNormalTargetGenerator::calculateCommandLineLength() was not
implemented for certain operating systems such as the BSDs despite the
fact that sysconf(_SC_ARG_MAX) also works there. This caused problems
when generating static libraries, as ar(1) on FreeBSD does not recognize
the @file argument syntax.
By generalizing the checks for whether to use sysconf(_SC_ARG_MAX) this
problem can be worked around and we avoid having to change the #ifdef
for each new operating system implementing sysconf(3) according to
POSIX.
---
Source/cmNinjaNormalTargetGenerator.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx
b/Source/cmNinjaNormalTargetGenerator.cxx
index c34df3c..5e965ff 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -375,7 +375,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
--
2.9.0
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers