diff options
author | Christian Pfeiffer <cpfeiffer@live.de> | 2017-04-18 21:06:39 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-04-19 15:02:24 (GMT) |
commit | bbb5c3efe2a17d046506b7c27008c77ea244f0bc (patch) | |
tree | efa83801c7982bd247727af35fa6e7f15a13aedc /Source/cmMakefileTargetGenerator.cxx | |
parent | ddd2b02455db9b0ef3604af1b9b10c22af56bff9 (diff) | |
download | CMake-bbb5c3efe2a17d046506b7c27008c77ea244f0bc.zip CMake-bbb5c3efe2a17d046506b7c27008c77ea244f0bc.tar.gz CMake-bbb5c3efe2a17d046506b7c27008c77ea244f0bc.tar.bz2 |
Ninja,Makefile: Unify command line limit logic
Move the logic to cmSystemTools to be shared among the generators.
Revise the implementation and add comments justifying each possible
source for a limit.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index ed38024..dd5cd7d 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -30,10 +30,6 @@ #include "cm_auto_ptr.hxx" #include "cmake.h" -#ifndef _WIN32 -#include <unistd.h> -#endif - cmMakefileTargetGenerator::cmMakefileTargetGenerator(cmGeneratorTarget* target) : cmCommonTargetGenerator(target) , OSXBundleGenerator(CM_NULLPTR) @@ -1492,15 +1488,6 @@ void cmMakefileTargetGenerator::CreateLinkScript( makefile_depends.push_back(linkScriptName); } -static size_t calculateCommandLineLengthLimit() -{ -#if defined(_SC_ARG_MAX) - return ((size_t)sysconf(_SC_ARG_MAX)) - 1000; -#else - return 0; -#endif -} - bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects( std::string const& l) const { @@ -1514,7 +1501,7 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects( } // Check for a system limit. - if (size_t const limit = calculateCommandLineLengthLimit()) { + if (size_t const limit = cmSystemTools::CalculateCommandLineLengthLimit()) { // Compute the total length of our list of object files with room // for argument separation and quoting. This does not convert paths // relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so the |