diff options
author | Thomas Bernard <tbernard@go-engineering.de> | 2020-07-21 18:13:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-08-07 15:52:45 (GMT) |
commit | 20ebaed97235d8397638807ff791803f8bd4e215 (patch) | |
tree | d1d1e2ffa88b2c27fcee0be212ec27ea90fc64ad /Source/cmLocalGenerator.cxx | |
parent | d993ebd4ca0fc1044745dd1874bab082090f9801 (diff) | |
download | CMake-20ebaed97235d8397638807ff791803f8bd4e215.zip CMake-20ebaed97235d8397638807ff791803f8bd4e215.tar.gz CMake-20ebaed97235d8397638807ff791803f8bd4e215.tar.bz2 |
Clang: Add support for passing VFS arguments
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 4d39312..dc3bf47 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1938,6 +1938,9 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, this->AddConfigVariableFlags(flags, cmStrCat("CMAKE_", lang, "_FLAGS"), config); + std::string const& compiler = this->Makefile->GetSafeDefinition( + cmStrCat("CMAKE_", lang, "_COMPILER_ID")); + if (lang == "Swift") { if (cmProp v = target->GetProperty("Swift_LANGUAGE_VERSION")) { if (cmSystemTools::VersionCompare( @@ -1951,9 +1954,6 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, target->AddCUDAArchitectureFlags(flags); target->AddCUDAToolkitFlags(flags); - std::string const& compiler = - this->Makefile->GetSafeDefinition("CMAKE_CUDA_COMPILER_ID"); - if (compiler == "Clang") { bool separable = target->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION"); @@ -1965,7 +1965,24 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, } } } - + // Add VFS Overlay for Clang compiliers + if (compiler == "Clang") { + if (const char* vfsOverlay = + this->Makefile->GetDefinition("CMAKE_CLANG_VFS_OVERLAY")) { + std::string const& compilerSimulateId = + this->Makefile->GetSafeDefinition( + cmStrCat("CMAKE_", lang, "_SIMULATE_ID")); + if (compilerSimulateId == "MSVC") { + this->AppendCompileOptions( + flags, + std::vector<std::string>{ "-Xclang", "-ivfsoverlay", "-Xclang", + vfsOverlay }); + } else { + this->AppendCompileOptions( + flags, std::vector<std::string>{ "-ivfsoverlay", vfsOverlay }); + } + } + } // Add MSVC runtime library flags. This is activated by the presence // of a default selection whether or not it is overridden by a property. cmProp msvcRuntimeLibraryDefault = |