summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:14:05 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:14:05 +0900
commit2916e0eaa4feeff9c06755fc988ec867c23bb2db (patch)
tree2b9272a53693052de544019e9c842dc5c1d06f4f /Source
parentd140263a497b4a86818ab5e2017a66df43eb83fb (diff)
downloadcmake-2916e0eaa4feeff9c06755fc988ec867c23bb2db.tar.gz
cmake-2916e0eaa4feeff9c06755fc988ec867c23bb2db.tar.bz2
cmake-2916e0eaa4feeff9c06755fc988ec867c23bb2db.zip
Imported Upstream version 3.15.1upstream/3.15.1
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx18
-rw-r--r--Source/cmCustomCommandGenerator.cxx2
-rw-r--r--Source/cmLinkLineComputer.cxx34
-rw-r--r--Source/cmLocalGenerator.cxx21
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx3
-rw-r--r--Source/kwsys/SystemTools.cxx7
-rw-r--r--Source/kwsys/testSystemTools.cxx8
9 files changed, 69 insertions, 29 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ebdb97a29..4b4f9b0d6 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 15)
-set(CMake_VERSION_PATCH 0)
+set(CMake_VERSION_PATCH 1)
#set(CMake_VERSION_RC 0)
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 1fa7988b7..54c4bae08 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -266,15 +266,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
}
}
- upload_as += "&MD5=";
-
- if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
- upload_as += "bad_md5sum";
- } else {
- upload_as +=
- cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
- }
-
// Generate Done.xml right before it is submitted.
// The reason for this is two-fold:
// 1) It must be generated after some other part has been submitted
@@ -286,6 +277,15 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
this->CTest->GenerateDoneFile();
}
+ upload_as += "&MD5=";
+
+ if (cmSystemTools::IsOn(this->GetOption("InternalTest"))) {
+ upload_as += "bad_md5sum";
+ } else {
+ upload_as +=
+ cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
+ }
+
if (!cmSystemTools::FileExists(local_file)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot find file: " << local_file << std::endl);
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 89aaad0dc..fe228ff2d 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -25,6 +25,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
, OldStyle(cc.GetEscapeOldStyle())
, MakeVars(cc.GetEscapeAllowMakeVars())
, GE(new cmGeneratorExpression(cc.GetBacktrace()))
+ , EmulatorsWithArguments(cc.GetCommandLines().size())
{
const cmCustomCommandLines& cmdlines = this->CC.GetCommandLines();
for (cmCustomCommandLine const& cmdline : cmdlines) {
@@ -107,7 +108,6 @@ void cmCustomCommandGenerator::FillEmulatorsWithArguments()
continue;
}
- this->EmulatorsWithArguments.emplace_back();
cmSystemTools::ExpandListArgument(emulator_property,
this->EmulatorsWithArguments[c]);
}
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index 2a8bee6e5..469faca88 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -99,14 +99,34 @@ std::string cmLinkLineComputer::ComputeLinkPath(
std::string const& libPathTerminator)
{
std::string linkPath;
- std::vector<std::string> const& libDirs = cli.GetDirectories();
- for (std::string const& libDir : libDirs) {
- std::string libpath = this->ConvertToOutputForExisting(libDir);
- linkPath += " " + libPathFlag;
- linkPath += libpath;
- linkPath += libPathTerminator;
- linkPath += " ";
+
+ if (cli.GetLinkLanguage() == "Swift") {
+ for (const cmComputeLinkInformation::Item& item : cli.GetItems()) {
+ const cmGeneratorTarget* target = item.Target;
+ if (!target) {
+ continue;
+ }
+
+ if (target->GetType() == cmStateEnums::STATIC_LIBRARY ||
+ target->GetType() == cmStateEnums::SHARED_LIBRARY) {
+ cmStateEnums::ArtifactType type = cmStateEnums::RuntimeBinaryArtifact;
+ if (target->GetType() == cmStateEnums::SHARED_LIBRARY &&
+ target->IsDLLPlatform()) {
+ type = cmStateEnums::ImportLibraryArtifact;
+ }
+
+ linkPath += " " + libPathFlag +
+ item.Target->GetDirectory(cli.GetConfig(), type) +
+ libPathTerminator + " ";
+ }
+ }
}
+
+ for (std::string const& libDir : cli.GetDirectories()) {
+ linkPath += " " + libPathFlag + this->ConvertToOutputForExisting(libDir) +
+ libPathTerminator + " ";
+ }
+
return linkPath;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index fe5c8afe1..3abf2ddda 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1444,10 +1444,23 @@ void cmLocalGenerator::OutputLinkLibraries(
std::string linkLanguage = cli.GetLinkLanguage();
- const std::string& libPathFlag =
- this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
- const std::string& libPathTerminator =
- this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
+ std::string libPathFlag;
+ if (const char* value = this->Makefile->GetDefinition(
+ "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_FLAG")) {
+ libPathFlag = value;
+ } else {
+ libPathFlag =
+ this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
+ }
+
+ std::string libPathTerminator;
+ if (const char* value = this->Makefile->GetDefinition(
+ "CMAKE_" + cli.GetLinkLanguage() + "_LIBRARY_PATH_TERMINATOR")) {
+ libPathTerminator = value;
+ } else {
+ libPathTerminator =
+ this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
+ }
// Add standard libraries for this language.
std::string standardLibsVar = "CMAKE_";
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7ba347177..8154f3e1c 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -703,8 +703,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
}
Options targetOptions(this, t, table, gg->ExtraFlagTable);
targetOptions.FixExceptionHandlingDefault();
- std::string asmLocation = configName + "/";
- targetOptions.AddFlag("AssemblerListingLocation", asmLocation);
+ targetOptions.AddFlag("AssemblerListingLocation", "$(IntDir)\\");
targetOptions.Parse(flags);
targetOptions.Parse(defineFlags);
targetOptions.ParseFinish();
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index ee5f9b4d0..8c6ba4edf 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2643,8 +2643,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
clOptions.AddFlag("UseFullPaths", "false");
}
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
- std::string asmLocation = configName + "/";
- clOptions.AddFlag("AssemblerListingLocation", asmLocation);
+ clOptions.AddFlag("AssemblerListingLocation", "$(IntDir)");
}
}
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 2135913f5..ae7a18a8c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -3394,8 +3394,13 @@ static void SystemToolsAppendComponents(
static const std::string cur = ".";
for (std::vector<std::string>::const_iterator i = first; i != last; ++i) {
if (*i == up) {
- if (out_components.size() > 1) {
+ // Remove the previous component if possible. Ignore ../ components
+ // that try to go above the root. Keep ../ components if they are
+ // at the beginning of a relative path (base path is relative).
+ if (out_components.size() > 1 && out_components.back() != up) {
out_components.resize(out_components.size() - 1);
+ } else if (!out_components.empty() && out_components[0].empty()) {
+ out_components.emplace_back(std::move(*i));
}
} else if (!i->empty() && *i != cur) {
#if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 9a40b5330..ffa6a297d 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -684,9 +684,10 @@ static bool CheckRelativePaths()
}
static bool CheckCollapsePath(const std::string& path,
- const std::string& expected)
+ const std::string& expected,
+ const char* base = nullptr)
{
- std::string result = kwsys::SystemTools::CollapseFullPath(path);
+ std::string result = kwsys::SystemTools::CollapseFullPath(path, base);
if (!kwsys::SystemTools::ComparePath(expected, result)) {
std::cerr << "CollapseFullPath(" << path << ") yielded " << result
<< " instead of " << expected << std::endl;
@@ -710,6 +711,9 @@ static bool CheckCollapsePath()
res &= CheckCollapsePath("C:/", "C:/");
res &= CheckCollapsePath("C:/../", "C:/");
res &= CheckCollapsePath("C:/../../", "C:/");
+ res &= CheckCollapsePath("../b", "../../b", "../");
+ res &= CheckCollapsePath("../a/../b", "../b", "../rel");
+ res &= CheckCollapsePath("a/../b", "../rel/b", "../rel");
return res;
}