diff options
-rw-r--r-- | CompileFlags.cmake | 6 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 14 |
4 files changed, 35 insertions, 17 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 1c5f1be..e6fb20b 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -26,6 +26,12 @@ if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stack:10000000") endif() +# MSVC 14.28 enables C5105, but the Windows SDK 10.0.18362.0 triggers it. +if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 19.28) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd5105") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd5105") +endif() + if(_CLANG_MSVC_WINDOWS AND "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker -stack:20000000") endif() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index aad6371..7d09a7b 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 19) -set(CMake_VERSION_PATCH 20201116) +set(CMake_VERSION_PATCH 20201117) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 91f8c2b..026e96c 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3441,10 +3441,16 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) if (!libTarget) { if (libItem->IsPath) { // Get or create a direct file ref in the root project - auto it = this->ExternalLibRefs.find(libItem->Value.Value); + auto cleanPath = libItem->Value.Value; + if (cmSystemTools::FileIsFullPath(cleanPath)) { + // Some arguments are reported as paths, but they are actually not, + // so we can't collapse them, and neither can we collapse relative + // paths + cleanPath = cmSystemTools::CollapseFullPath(cleanPath); + } + auto it = this->ExternalLibRefs.find(cleanPath); if (it == this->ExternalLibRefs.end()) { - buildFile = CreateXCodeBuildFileFromPath(libItem->Value.Value, gt, - "", nullptr); + buildFile = CreateXCodeBuildFileFromPath(cleanPath, gt, "", nullptr); if (!buildFile) { // Add this library item back to a regular linker flag list for (const auto& conf : configItemMap) { @@ -3452,7 +3458,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) } continue; } - this->ExternalLibRefs.emplace(libItem->Value.Value, buildFile); + this->ExternalLibRefs.emplace(cleanPath, buildFile); } else { buildFile = it->second; } @@ -3584,7 +3590,11 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) for (auto const& libItem : configItemMap[configName]) { auto const& libName = *libItem; if (libName.IsPath) { - const auto libPath = GetLibraryOrFrameworkPath(libName.Value.Value); + auto cleanPath = libName.Value.Value; + if (cmSystemTools::FileIsFullPath(cleanPath)) { + cleanPath = cmSystemTools::CollapseFullPath(cleanPath); + } + const auto libPath = GetLibraryOrFrameworkPath(cleanPath); if (cmSystemTools::StringEndsWith(libPath.c_str(), ".framework")) { const auto fwName = cmSystemTools::GetFilenameWithoutExtension(libPath); @@ -3592,17 +3602,17 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) libPaths.Add("-F " + this->XCodeEscapePath(fwDir)); libPaths.Add("-framework " + fwName); } else { - libPaths.Add(this->XCodeEscapePath(libName.Value.Value)); + libPaths.Add(this->XCodeEscapePath(cleanPath)); } if ((!libName.Target || libName.Target->IsImported()) && IsLinkPhaseLibraryExtension(libPath)) { // Create file reference for embedding - auto it = this->ExternalLibRefs.find(libName.Value.Value); + auto it = this->ExternalLibRefs.find(cleanPath); if (it == this->ExternalLibRefs.end()) { - auto* buildFile = this->CreateXCodeBuildFileFromPath( - libName.Value.Value, gt, "", nullptr); + auto* buildFile = + this->CreateXCodeBuildFileFromPath(cleanPath, gt, "", nullptr); if (buildFile) { - this->ExternalLibRefs.emplace(libName.Value.Value, buildFile); + this->ExternalLibRefs.emplace(cleanPath, buildFile); } } } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2054200..8a3f285 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2607,14 +2607,16 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) // Add pchHeader to source files, which will // be grouped as "Precompile Header File" auto pchHeader_sf = this->Makefile->GetOrCreateSource( - pchHeader, true, cmSourceFileLocationKind::Known); + pchHeader, false, cmSourceFileLocationKind::Known); std::string err; pchHeader_sf->ResolveFullPath(&err); - - // The pch file is generated, but mark it as not generated - // so that a clean operation will not remove it from disk - pchHeader_sf->SetProperty("GENERATED", "0"); - + if (!err.empty()) { + std::ostringstream msg; + msg << "Unable to resolve full path of PCH-header '" << pchHeader + << "' assigned to target " << target->GetName() + << ", although its path is supposed to be known!"; + this->IssueMessage(MessageType::FATAL_ERROR, msg.str()); + } target->AddSource(pchHeader); } } |