diff options
author | Brad King <brad.king@kitware.com> | 2016-07-20 18:39:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-07-20 19:00:56 (GMT) |
commit | 34ba5c53481e7f2101dafa735504cb98f94ec6db (patch) | |
tree | e049ca0ea0dc098bcf75ad0dfb2ead07f2ae0c68 /Source/cmMakefileTargetGenerator.cxx | |
parent | df14a98e9c4af316cd5e75d6af8cc7b75da2db8f (diff) | |
download | CMake-34ba5c53481e7f2101dafa735504cb98f94ec6db.zip CMake-34ba5c53481e7f2101dafa735504cb98f94ec6db.tar.gz CMake-34ba5c53481e7f2101dafa735504cb98f94ec6db.tar.bz2 |
Makefile: Factor out response file checks into common helper
Factor CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_{OBJECTS,LIBRARIES} lookup out
into a common helper. Use a separate helper for each because more
specific logic may be added to each later.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 00b1219..abf50d6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1447,6 +1447,38 @@ void cmMakefileTargetGenerator::CreateLinkScript( makefile_depends.push_back(linkScriptName); } +bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects( + std::string const& l) const +{ + // Check for an explicit setting one way or the other. + std::string const responseVar = + "CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_OBJECTS"; + if (const char* val = this->Makefile->GetDefinition(responseVar)) { + if (*val) { + return cmSystemTools::IsOn(val); + } + } + + // We do not need a response file for objects. + return false; +} + +bool cmMakefileTargetGenerator::CheckUseResponseFileForLibraries( + std::string const& l) const +{ + // Check for an explicit setting one way or the other. + std::string const responseVar = + "CMAKE_" + l + "_USE_RESPONSE_FILE_FOR_LIBRARIES"; + if (const char* val = this->Makefile->GetDefinition(responseVar)) { + if (*val) { + return cmSystemTools::IsOn(val); + } + } + + // We do not need a response file for libraries. + return false; +} + std::string cmMakefileTargetGenerator::CreateResponseFile( const char* name, std::string const& options, std::vector<std::string>& makefile_depends) |