summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx13
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx2
-rw-r--r--Source/cmFileCommand.cxx6
-rw-r--r--Source/cmFortranParser.h3
-rw-r--r--Source/cmFortranParserImpl.cxx1
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx6
-rw-r--r--Source/cmIDEOptions.cxx5
-rw-r--r--Source/cmIDEOptions.h2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx10
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx14
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx12
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx5
-rw-r--r--Source/kwsys/FStream.hxx.in4
14 files changed, 59 insertions, 26 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 8f2fcac..e88a12b 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 8)
-set(CMake_VERSION_PATCH 20170327)
+set(CMake_VERSION_PATCH 20170330)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 7da93ac..e135ac6 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -7,6 +7,12 @@
#include "cmMakefile.h"
#include "cmsys/SystemInformation.hxx"
+#if defined(_WIN32)
+#include "cmSystemTools.h"
+#include "cmVSSetupHelper.h"
+#define HAVE_VS_SETUP_HELPER
+#endif
+
class cmExecutionStatus;
// cmCMakeHostSystemInformation
@@ -70,6 +76,13 @@ bool cmCMakeHostSystemInformationCommand::GetValue(
value = this->ValueToString(info.GetTotalPhysicalMemory());
} else if (key == "AVAILABLE_PHYSICAL_MEMORY") {
value = this->ValueToString(info.GetAvailablePhysicalMemory());
+#ifdef HAVE_VS_SETUP_HELPER
+ } else if (key == "VS_15_DIR") {
+ cmVSSetupAPIHelper vsSetupAPIHelper;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(value)) {
+ cmSystemTools::ConvertToUnixSlashes(value);
+ }
+#endif
} else {
std::string e = "does not recognize <key> " + key;
this->SetError(e);
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 2d66344..1222d5a 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCommandArgumentParserHelper.h"
-#include <cm_kwiml.h>
-
#include "cmCommandArgumentLexer.h"
#include "cmMakefile.h"
#include "cmState.h"
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 97292f9..63012a5 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -37,6 +37,7 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
#include "cmCurl.h"
#include "cmFileLockResult.h"
+#include <cm_curl.h>
#endif
#if defined(CMAKE_USE_ELF_PARSER)
@@ -1028,8 +1029,6 @@ protected:
{
}
};
- struct MatchRule;
- friend struct MatchRule;
struct MatchRule
{
cmsys::RegularExpression Regex;
@@ -1486,6 +1485,9 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
// Remove the destination file so we can always create the symlink.
cmSystemTools::RemoveFile(toFile);
+ // Create destination directory if it doesn't exist
+ cmSystemTools::MakeDirectory(cmSystemTools::GetFilenamePath(toFile));
+
// Create the symlink.
if (!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) {
std::ostringstream e;
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
index e8273fb..024b00a 100644
--- a/Source/cmFortranParser.h
+++ b/Source/cmFortranParser.h
@@ -54,8 +54,7 @@ void cmFortranParser_RuleElse(cmFortranParser* parser);
void cmFortranParser_RuleEndif(cmFortranParser* parser);
/* Define the parser stack element type. */
-typedef union cmFortran_yystype_u cmFortran_yystype;
-union cmFortran_yystype_u
+struct cmFortran_yystype
{
char* string;
};
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 1a5e6c5..1abe673 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -1,7 +1,6 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmFortranParser.h"
-#include "cmFortranLexer.h"
#include "cmSystemTools.h"
#include <assert.h>
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 39f7b8f..42dd997 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3117,10 +3117,14 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this->CreateString(this->GeneratorToolset));
}
if (this->GetLanguageEnabled("Swift")) {
- std::string swiftVersion = "2.3";
+ std::string swiftVersion;
if (const char* vers = this->CurrentMakefile->GetDefinition(
"CMAKE_Swift_LANGUAGE_VERSION")) {
swiftVersion = vers;
+ } else if (this->XcodeVersion >= 83) {
+ swiftVersion = "3.0";
+ } else {
+ swiftVersion = "2.3";
}
buildSettings->AddAttribute("SWIFT_VERSION",
this->CreateString(swiftVersion));
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index 1c0a99e..bda6b75 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -150,6 +150,11 @@ void cmIDEOptions::AddDefines(const std::vector<std::string>& defines)
this->Defines.insert(this->Defines.end(), defines.begin(), defines.end());
}
+std::vector<std::string> const& cmIDEOptions::GetDefines() const
+{
+ return this->Defines;
+}
+
void cmIDEOptions::AddFlag(const char* flag, const char* value)
{
this->FlagMap[flag] = value;
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index 465cf2c..11f8aba 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -24,6 +24,8 @@ public:
void AddDefine(const std::string& define);
void AddDefines(const char* defines);
void AddDefines(const std::vector<std::string>& defines);
+ std::vector<std::string> const& GetDefines() const;
+
void AddFlag(const char* flag, const char* value);
void AddFlag(const char* flag, std::vector<std::string> const& value);
void AppendFlag(std::string const& flag, std::string const& value);
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7c33821..3117ef3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -746,11 +746,13 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
if (this->FortranProject) {
// Intel Fortran >= 15.0 uses TargetName property.
- std::string targetNameFull = target->GetFullName(configName);
- std::string targetName =
+ std::string const targetNameFull = target->GetFullName(configName);
+ std::string const targetName =
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
- std::string targetExt =
- cmSystemTools::GetFilenameLastExtension(targetNameFull);
+ std::string const targetExt =
+ target->GetType() == cmStateEnums::OBJECT_LIBRARY
+ ? ".lib"
+ : cmSystemTools::GetFilenameLastExtension(targetNameFull);
/* clang-format off */
fout <<
"\t\t\tTargetName=\"" << this->EscapeForXML(targetName) << "\"\n"
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 5552fa9..560eb4f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -544,10 +544,6 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
#ifdef _WIN32
8000,
#endif
-#if defined(_SC_ARG_MAX)
- // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
- ((int)sysconf(_SC_ARG_MAX)) - 1000,
-#endif
#if defined(__linux)
// #define MAX_ARG_STRLEN (PAGE_SIZE * 32) in Linux's binfmts.h
((int)sysconf(_SC_PAGESIZE) * 32) - 1000,
@@ -556,7 +552,15 @@ static int calculateCommandLineLengthLimit(int linkRuleLength)
};
size_t const arrSz = cmArraySize(limits);
- int const sz = *std::min_element(limits, limits + arrSz);
+ int sz = *std::min_element(limits, limits + arrSz);
+#if defined(_SC_ARG_MAX)
+ // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
+ int const szArgMax = static_cast<int>(sysconf(_SC_ARG_MAX));
+ // a return value of -1 signifies an unrestricted value
+ if (szArgMax != -1) {
+ sz = std::min(sz, szArgMax - 1000);
+ }
+#endif
if (sz == std::numeric_limits<int>::max()) {
return 0;
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 84767a8..9c9296e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2402,6 +2402,11 @@ bool cmVisualStudio10TargetGenerator::ComputeRcOptions(
std::string(this->Makefile->GetSafeDefinition(rcConfigFlagsVar));
rcOptions.Parse(flags.c_str());
+
+ // For historical reasons, add the C preprocessor defines to RC.
+ Options& clOptions = *(this->ClOptions[configName]);
+ rcOptions.AddDefines(clOptions.GetDefines());
+
this->RcOptions[configName] = pOptions.release();
return true;
}
@@ -2414,12 +2419,9 @@ void cmVisualStudio10TargetGenerator::WriteRCOptions(
}
this->WriteString("<ResourceCompile>\n", 2);
- // Preprocessor definitions and includes are shared with clOptions.
- Options& clOptions = *(this->ClOptions[configName]);
- clOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
- "\n", "RC");
-
Options& rcOptions = *(this->RcOptions[configName]);
+ rcOptions.OutputPreprocessorDefinitions(*this->BuildFileStream, " ",
+ "\n", "RC");
rcOptions.AppendFlag("AdditionalIncludeDirectories", includes);
rcOptions.AppendFlag("AdditionalIncludeDirectories",
"%(AdditionalIncludeDirectories)");
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 1ca6b9c..abc4924 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -1,5 +1,6 @@
#include "cmVisualStudioGeneratorOptions.h"
+#include "cmAlgorithms.h"
#include "cmLocalVisualStudioGenerator.h"
#include "cmOutputConverter.h"
#include "cmSystemTools.h"
@@ -403,8 +404,10 @@ void cmVisualStudioGeneratorOptions::OutputPreprocessorDefinitions(
fout << prefix << tag << "=\"";
}
const char* sep = "";
+ std::vector<std::string>::const_iterator de =
+ cmRemoveDuplicates(this->Defines);
for (std::vector<std::string>::const_iterator di = this->Defines.begin();
- di != this->Defines.end(); ++di) {
+ di != de; ++di) {
// Escape the definition for the compiler.
std::string define;
if (this->Version < cmGlobalVisualStudioGenerator::VS10) {
diff --git a/Source/kwsys/FStream.hxx.in b/Source/kwsys/FStream.hxx.in
index cf331a5..d4bc6c9 100644
--- a/Source/kwsys/FStream.hxx.in
+++ b/Source/kwsys/FStream.hxx.in
@@ -170,8 +170,6 @@ template <typename CharType, typename Traits = std::char_traits<CharType> >
class basic_ifstream : public std::basic_istream<CharType, Traits>,
public basic_efilebuf<CharType, Traits>
{
- using basic_efilebuf<CharType, Traits>::is_open;
-
public:
typedef typename basic_efilebuf<CharType, Traits>::internal_buffer_type
internal_buffer_type;
@@ -201,6 +199,8 @@ public:
void close() { this->_set_state(this->_close(), this, this); }
+ using basic_efilebuf<CharType, Traits>::is_open;
+
internal_buffer_type* rdbuf() const { return this->buf_; }
~basic_ifstream() @KWSYS_NAMESPACE@_FStream_NOEXCEPT { close(); }