diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 24 |
2 files changed, 19 insertions, 9 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index fcb27b4..272535d 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -599,7 +599,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, fprintf(fout, "link_directories(${LINK_DIRECTORIES})\n"); // handle any compile flags we need to pass on if (!compileDefs.empty()) { - fprintf(fout, "add_definitions(%s)\n", cmJoin(compileDefs, " ").c_str()); + // Pass using bracket arguments to preserve content. + fprintf(fout, "add_definitions([==[%s]==])\n", + cmJoin(compileDefs, "]==] [==[").c_str()); } /* Use a random file name to avoid rapid creation and deletion diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 97e684b..23afbd0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -947,21 +947,29 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories( rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT"); } + std::vector<std::string> impDirVec; + + // Get platform-wide implicit directories. + if (const char* implicitIncludes = (this->Makefile->GetDefinition( + "CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"))) { + cmSystemTools::ExpandListArgument(implicitIncludes, impDirVec); + } + // Load implicit include directories for this language. std::string key = "CMAKE_"; key += lang; key += "_IMPLICIT_INCLUDE_DIRECTORIES"; if (const char* value = this->Makefile->GetDefinition(key)) { - std::vector<std::string> impDirVec; cmSystemTools::ExpandListArgument(value, impDirVec); - for (std::string const& i : impDirVec) { - { - std::string d = rootPath + i; - cmSystemTools::ConvertToUnixSlashes(d); - emitted.insert(std::move(d)); - } - implicitDirs.push_back(i); + } + + for (std::string const& i : impDirVec) { + { + std::string d = rootPath + i; + cmSystemTools::ConvertToUnixSlashes(d); + emitted.insert(std::move(d)); } + implicitDirs.push_back(i); } } |