diff options
author | Alexander Grund <Flamefire@users.noreply.github.com> | 2021-07-06 14:11:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-07-06 23:19:46 (GMT) |
commit | 429fb28f25752352db876f634d3b317962cfeb7d (patch) | |
tree | 8b6fa9665fa51a9f1451808d1317f44b7b9f05f0 /Source/cmLocalGenerator.cxx | |
parent | 28979a59683a955b45b9a6fdcf0170e1d7826934 (diff) | |
download | CMake-429fb28f25752352db876f634d3b317962cfeb7d.zip CMake-429fb28f25752352db876f634d3b317962cfeb7d.tar.gz CMake-429fb28f25752352db876f634d3b317962cfeb7d.tar.bz2 |
cmLocalGenerator: Factor out repeated condition into local variable
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a14f085..f58f142 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1247,9 +1247,11 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( } } + bool const isCorCxx = (lang == "C" || lang == "CXX"); + // Checks if this is not an excluded (implicit) include directory. auto notExcluded = [this, &implicitSet, &implicitExclude, - &lang](std::string const& dir) { + isCorCxx](std::string const& dir) { return ( // Do not exclude directories that are not in an excluded set. ((!cm::contains(implicitSet, this->GlobalGenerator->GetRealPath(dir))) && @@ -1258,8 +1260,7 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit( // they are implicitly searched by the compiler. They are meant to be // user-specified directories that can be re-ordered or converted to // -isystem without breaking real compiler builtin headers. - || - ((lang == "C" || lang == "CXX") && cm::contains(this->EnvCPATH, dir))); + || (isCorCxx && cm::contains(this->EnvCPATH, dir))); }; // Get the target-specific include directories. |