diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:54 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:20:54 +0900 |
commit | 0a793b9589edea1ea74c0bfcbfef46c1a37f7291 (patch) | |
tree | 029cc0701858b6d931b4a650587c8c77864abf28 | |
parent | a53f5e14296e61603e2bca1a125d51e7390deca3 (diff) | |
download | cmake-0a793b9589edea1ea74c0bfcbfef46c1a37f7291.tar.gz cmake-0a793b9589edea1ea74c0bfcbfef46c1a37f7291.tar.bz2 cmake-0a793b9589edea1ea74c0bfcbfef46c1a37f7291.zip |
Imported Upstream version 3.20.5upstream/3.20.5
-rw-r--r-- | Help/release/3.20.rst | 7 | ||||
-rw-r--r-- | Modules/ExternalProject-gitupdate.cmake.in | 2 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 4 | ||||
-rw-r--r-- | Source/cmCommands.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 26 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 7 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 17 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmState.cxx | 9 | ||||
-rw-r--r-- | Source/cmState.h | 2 | ||||
-rw-r--r-- | Tests/BuildDepends/Project/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/OverrideProject-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/OverrideProject-stderr.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/Syntax/RunCMakeTest.cmake | 1 |
15 files changed, 72 insertions, 27 deletions
diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst index f77304fcf..da27174d7 100644 --- a/Help/release/3.20.rst +++ b/Help/release/3.20.rst @@ -362,3 +362,10 @@ Changes made since CMake 3.20.0 include the following. 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. diff --git a/Modules/ExternalProject-gitupdate.cmake.in b/Modules/ExternalProject-gitupdate.cmake.in index 461e32354..0de2372ec 100644 --- a/Modules/ExternalProject-gitupdate.cmake.in +++ b/Modules/ExternalProject-gitupdate.cmake.in @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.5) 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 diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 89579dd9a..7a14f55ec 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 20) -set(CMake_VERSION_PATCH 4) +set(CMake_VERSION_PATCH 5) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) @@ -21,7 +21,7 @@ endif() 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]* " diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 9e5b78351..a241a3a64 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -164,36 +164,36 @@ void GetScriptingCommands(cmState* state) 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 " diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index badce2eb5..b911eef40 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -1313,8 +1313,12 @@ static unsigned int cmLoadFlagTableSpecial(Json::Value entry, 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); @@ -1336,6 +1340,11 @@ static cmIDEFlagTable const* cmLoadFlagTableJson( 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 }; @@ -1349,12 +1358,13 @@ static cmIDEFlagTable const* cmLoadFlagTableJson( 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, @@ -1362,17 +1372,19 @@ cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable( { 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); } } diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 8d30ef8e8..5022a0fe5 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -5,6 +5,8 @@ #include <memory> #include <set> +#include <cm/optional> + #include "cmGlobalVisualStudio8Generator.h" #include "cmVisualStudio10ToolsetOptions.h" @@ -119,6 +121,11 @@ public: 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; diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index c11ab1bf8..50dc30b32 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -391,10 +391,15 @@ bool cmGlobalVisualStudioVersionedGenerator::GetVSInstance( 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 @@ -407,9 +412,9 @@ 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* diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h index cee129e52..105e4954b 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.h +++ b/Source/cmGlobalVisualStudioVersionedGenerator.h @@ -28,7 +28,7 @@ public: 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; diff --git a/Source/cmState.cxx b/Source/cmState.cxx index d97762bb6..929b0fba9 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -480,7 +480,7 @@ void cmState::AddDisallowedCommand(std::string const& name, void cmState::AddUnexpectedCommand(std::string const& name, const char* error) { - this->AddFlowControlCommand( + this->AddBuiltinCommand( name, [name, error](std::vector<cmListFileArgument> const&, cmExecutionStatus& status) -> bool { @@ -495,6 +495,13 @@ void cmState::AddUnexpectedCommand(std::string const& name, const char* error) }); } +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) { diff --git a/Source/cmState.h b/Source/cmState.h index 4e411560a..9951b9acf 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -166,6 +166,8 @@ public: 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); diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index c2576f3e3..7fddf4b03 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -8,7 +8,7 @@ if(APPLE) 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}") diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8e7c04fbd..bb83feab4 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -321,7 +321,7 @@ if(BUILD_TESTING) 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}") diff --git a/Tests/RunCMake/Syntax/OverrideProject-result.txt b/Tests/RunCMake/Syntax/OverrideProject-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Syntax/OverrideProject-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/OverrideProject-stderr.txt b/Tests/RunCMake/Syntax/OverrideProject-stderr.txt new file mode 100644 index 000000000..862d5c873 --- /dev/null +++ b/Tests/RunCMake/Syntax/OverrideProject-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error at [^ +]*/Tests/RunCMake/Syntax/Override\.cmake:[0-9]+ \(message\): + This shouldn't happen$ diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake index 4d246577b..f0c287cdb 100644 --- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -150,3 +150,4 @@ run_override(If) run_override(Macro) run_override(Return) run_override(While) +run_override(Project) |