a special case to recognize oneAPI 2021.1 Fortran as ``IntelLLVM``.
The oneAPI 2021.2 Fortran compiler defines the proper identification
macro and so is identified as ``IntelLLVM`` by all CMake 3.20 versions.
+
+3.20.3, 3.20.4, 3.20.5
+----------------------
+
+These versions made no changes to documented features or interfaces.
+Some implementation updates were made to support ecosystem changes
+and/or fix regressions.
function(get_hash_for_ref ref out_var err_var)
execute_process(
- COMMAND "@git_EXECUTABLE@" rev-parse "${ref}^{commit}"
+ COMMAND "@git_EXECUTABLE@" rev-parse "${ref}^0"
WORKING_DIRECTORY "@work_dir@"
RESULT_VARIABLE error_code
OUTPUT_VARIABLE ref_hash
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 20)
-set(CMake_VERSION_PATCH 4)
+set(CMake_VERSION_PATCH 5)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
if(NOT CMake_VERSION_NO_GIT)
# If this source was exported by 'git archive', use its commit info.
- set(git_info [==[b61fe6a831 CMake 3.20.4]==])
+ set(git_info [==[efa5e1f367 CMake 3.20.5]==])
# Otherwise, try to identify the current development source version.
if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
state->AddBuiltinCommand("string", cmStringCommand);
state->AddBuiltinCommand("unset", cmUnsetCommand);
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"else",
"An ELSE command was found outside of a proper "
"IF ENDIF structure. Or its arguments did not match "
"the opening IF command.");
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"elseif",
"An ELSEIF command was found outside of a proper "
"IF ENDIF structure.");
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"endforeach",
"An ENDFOREACH command was found outside of a proper "
"FOREACH ENDFOREACH structure. Or its arguments did "
"not match the opening FOREACH command.");
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"endfunction",
"An ENDFUNCTION command was found outside of a proper "
"FUNCTION ENDFUNCTION structure. Or its arguments did not "
"match the opening FUNCTION command.");
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"endif",
"An ENDIF command was found outside of a proper "
"IF ENDIF structure. Or its arguments did not match "
"the opening IF command.");
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"endmacro",
"An ENDMACRO command was found outside of a proper "
"MACRO ENDMACRO structure. Or its arguments did not "
"match the opening MACRO command.");
- state->AddUnexpectedCommand(
+ state->AddUnexpectedFlowControlCommand(
"endwhile",
"An ENDWHILE command was found outside of a proper "
"WHILE ENDWHILE structure. Or its arguments did not "
return value;
}
-static cmIDEFlagTable const* cmLoadFlagTableJson(
- std::string const& flagJsonPath)
+namespace {
+
+unsigned long long const vsVer16_10_0 = 4503644629696790;
+
+cmIDEFlagTable const* cmLoadFlagTableJson(
+ std::string const& flagJsonPath, cm::optional<unsigned long long> vsver)
{
cmIDEFlagTable* ret = nullptr;
auto savedFlagIterator = loadedFlagJsonFiles.find(flagJsonPath);
flagEntry.comment = cmLoadFlagTableString(flag, "comment");
flagEntry.value = cmLoadFlagTableString(flag, "value");
flagEntry.special = cmLoadFlagTableSpecial(flag, "flags");
+ // FIXME: Port this version check to a Json field.
+ if (vsver && *vsver < vsVer16_10_0 &&
+ flagEntry.IDEName == "ExternalWarningLevel") {
+ continue;
+ }
flagTable.push_back(flagEntry);
}
cmIDEFlagTable endFlag{ "", "", "", "", 0 };
return ret;
}
-static std::string cmGetFlagTableName(std::string const& toolsetName,
- std::string const& table)
+std::string cmGetFlagTableName(std::string const& toolsetName,
+ std::string const& table)
{
return cmSystemTools::GetCMakeRoot() + "/Templates/MSBuild/FlagTables/" +
toolsetName + "_" + table + ".json";
}
+}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable(
std::string const& optionsName, std::string const& toolsetName,
{
cmIDEFlagTable const* ret = nullptr;
+ cm::optional<unsigned long long> vsver = this->GetVSInstanceVersion();
+
std::string filename;
if (!optionsName.empty()) {
filename = cmGetFlagTableName(optionsName, table);
- ret = cmLoadFlagTableJson(filename);
+ ret = cmLoadFlagTableJson(filename, vsver);
} else {
filename = cmGetFlagTableName(toolsetName, table);
if (cmSystemTools::FileExists(filename)) {
- ret = cmLoadFlagTableJson(filename);
+ ret = cmLoadFlagTableJson(filename, vsver);
} else {
filename = cmGetFlagTableName(defaultName, table);
- ret = cmLoadFlagTableJson(filename);
+ ret = cmLoadFlagTableJson(filename, vsver);
}
}
#include <memory>
#include <set>
+#include <cm/optional>
+
#include "cmGlobalVisualStudio8Generator.h"
#include "cmVisualStudio10ToolsetOptions.h"
std::string Encoding() override;
const char* GetToolsVersion() const;
+ virtual cm::optional<unsigned long long> GetVSInstanceVersion() const
+ {
+ return {};
+ }
+
bool GetSupportsUnityBuilds() const { return this->SupportsUnityBuilds; }
bool FindMakeProgram(cmMakefile* mf) override;
return vsSetupAPIHelper.GetVSInstanceInfo(dir);
}
-bool cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion(
- unsigned long long& vsInstanceVersion) const
+cm::optional<unsigned long long>
+cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion() const
{
- return vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion);
+ cm::optional<unsigned long long> result;
+ unsigned long long vsInstanceVersion;
+ if (vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion)) {
+ result = vsInstanceVersion;
+ }
+ return result;
}
bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const
return false;
}
unsigned long long const vsInstanceVersion16_7_P2 = 4503631666610212;
- unsigned long long vsInstanceVersion;
- return (this->GetVSInstanceVersion(vsInstanceVersion) &&
- vsInstanceVersion > vsInstanceVersion16_7_P2);
+ cm::optional<unsigned long long> vsInstanceVersion =
+ this->GetVSInstanceVersion();
+ return (vsInstanceVersion && *vsInstanceVersion > vsInstanceVersion16_7_P2);
}
const char*
bool GetVSInstance(std::string& dir) const;
- bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion) const;
+ cm::optional<unsigned long long> GetVSInstanceVersion() const override;
AuxToolset FindAuxToolset(std::string& version,
std::string& props) const override;
void cmState::AddUnexpectedCommand(std::string const& name, const char* error)
{
- this->AddFlowControlCommand(
+ this->AddBuiltinCommand(
name,
[name, error](std::vector<cmListFileArgument> const&,
cmExecutionStatus& status) -> bool {
});
}
+void cmState::AddUnexpectedFlowControlCommand(std::string const& name,
+ const char* error)
+{
+ this->FlowControlCommands.insert(name);
+ this->AddUnexpectedCommand(name, error);
+}
+
bool cmState::AddScriptedCommand(std::string const& name, BT<Command> command,
cmMakefile& mf)
{
void AddDisallowedCommand(std::string const& name, BuiltinCommand command,
cmPolicies::PolicyID policy, const char* message);
void AddUnexpectedCommand(std::string const& name, const char* error);
+ void AddUnexpectedFlowControlCommand(std::string const& name,
+ const char* error);
bool AddScriptedCommand(std::string const& name, BT<Command> command,
cmMakefile& mf);
void RemoveBuiltinCommand(std::string const& name);
else()
execute_process(
COMMAND xcodebuild -version
- OUTPUT_VARIABLE _version ERROR_VARIABLE _version
+ OUTPUT_VARIABLE _version ERROR_VARIABLE _version_err
)
if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
else()
execute_process(
COMMAND xcodebuild -version
- OUTPUT_VARIABLE _version ERROR_VARIABLE _version
+ OUTPUT_VARIABLE _version ERROR_VARIABLE _version_err
)
if(_version MATCHES "^Xcode ([0-9]+(\\.[0-9]+)*)")
set(CMake_TEST_XCODE_VERSION "${CMAKE_MATCH_1}")
--- /dev/null
+^CMake Error at [^
+]*/Tests/RunCMake/Syntax/Override\.cmake:[0-9]+ \(message\):
+ This shouldn't happen$
run_override(Macro)
run_override(Return)
run_override(While)
+run_override(Project)