summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx54
1 files changed, 40 insertions, 14 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index f118250..851290a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1,12 +1,5 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#include "windows.h" // this must be first to define GetCurrentDirectory
-#if defined(_MSC_VER) && _MSC_VER >= 1800
-#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
-#endif
-#endif
-
#include "cmGlobalGenerator.h"
#include <algorithm>
@@ -19,6 +12,10 @@
#include <stdlib.h>
#include <string.h>
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+#endif
+
#include "cmAlgorithms.h"
#include "cmCPackPropertiesGenerator.h"
#include "cmComputeTargetDepends.h"
@@ -42,6 +39,7 @@
#include "cmStateDirectory.h"
#include "cmStateTypes.h"
#include "cmVersion.h"
+#include "cmWorkingDirectory.h"
#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -50,6 +48,10 @@
#include <cm_jsoncpp_writer.h>
#endif
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+#define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+#endif
+
const std::string kCMAKE_PLATFORM_INFO_INITIALIZED =
"CMAKE_PLATFORM_INFO_INITIALIZED";
@@ -1194,6 +1196,11 @@ void cmGlobalGenerator::AddCMP0042WarnTarget(const std::string& target)
this->CMP0042WarnTargets.insert(target);
}
+void cmGlobalGenerator::AddCMP0068WarnTarget(const std::string& target)
+{
+ this->CMP0068WarnTargets.insert(target);
+}
+
bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
{
// If the property is not enabled then okay.
@@ -1235,6 +1242,8 @@ bool cmGlobalGenerator::Compute()
// clear targets to issue warning CMP0042 for
this->CMP0042WarnTargets.clear();
+ // clear targets to issue warning CMP0068 for
+ this->CMP0068WarnTargets.clear();
// Check whether this generator is allowed to run.
if (!this->CheckALLOW_DUPLICATE_CUSTOM_TARGETS()) {
@@ -1366,6 +1375,24 @@ void cmGlobalGenerator::Generate()
this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
+ if (!this->CMP0068WarnTargets.empty()) {
+ std::ostringstream w;
+ /* clang-format off */
+ w <<
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0068) << "\n"
+ "For compatibility with older versions of CMake, the install_name "
+ "fields for the following targets are still affected by RPATH "
+ "settings:\n"
+ ;
+ /* clang-format on */
+ for (std::set<std::string>::iterator iter =
+ this->CMP0068WarnTargets.begin();
+ iter != this->CMP0068WarnTargets.end(); ++iter) {
+ w << " " << *iter << "\n";
+ }
+ this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ }
+
this->CMakeInstance->UpdateProgress("Generating done", -1);
}
@@ -1738,8 +1765,7 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
/**
* Run an executable command and put the stdout in output.
*/
- std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
- cmSystemTools::ChangeDirectory(bindir);
+ cmWorkingDirectory workdir(bindir);
output += "Change Dir: ";
output += bindir;
output += "\n";
@@ -1779,8 +1805,6 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
output += *outputPtr;
output += "\nGenerator: execution of make clean failed.\n";
- // return to the original directory
- cmSystemTools::ChangeDirectory(cwd);
return 1;
}
output += *outputPtr;
@@ -1803,8 +1827,6 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
output += "\nGenerator: execution of make failed. Make command was: " +
makeCommandStr + "\n";
- // return to the original directory
- cmSystemTools::ChangeDirectory(cwd);
return 1;
}
output += *outputPtr;
@@ -1817,7 +1839,6 @@ int cmGlobalGenerator::Build(const std::string& /*unused*/,
retVal = 1;
}
- cmSystemTools::ChangeDirectory(cwd);
return retVal;
}
@@ -2466,6 +2487,11 @@ std::string cmGlobalGenerator::GenerateRuleFile(
return ruleFile;
}
+bool cmGlobalGenerator::ShouldStripResourcePath(cmMakefile* mf) const
+{
+ return mf->PlatformIsAppleIos();
+}
+
std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
std::string const& l) const
{