[Cmake-commits] CMake branch, master, updated. v3.14.0-rc2-291-g6066aa4

Kitware Robot kwrobot at kitware.com
Thu Feb 28 11:43:03 EST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  6066aa471e28eb3d95b251d4d2a3bf83a31bba4f (commit)
       via  bfd71fc05c8495d9afefc920f2d59776b184098c (commit)
       via  a490ea4a2854a4c08f01b34bd444333e1bdbdc76 (commit)
       via  c7213ca87064ba47984b4dd07192389366d5856a (commit)
      from  4a79cdc85f885abfde9c3da393a55ef8ec947637 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6066aa471e28eb3d95b251d4d2a3bf83a31bba4f
commit 6066aa471e28eb3d95b251d4d2a3bf83a31bba4f
Merge: bfd71fc a490ea4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 28 16:42:06 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Feb 28 11:42:32 2019 -0500

    Merge topic 'optimize_ge_node_lookup'
    
    a490ea4a28 cmGeneratorExpressionNode: Initialize node key map in class constructor
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3031


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bfd71fc05c8495d9afefc920f2d59776b184098c
commit bfd71fc05c8495d9afefc920f2d59776b184098c
Merge: 4a79cdc c7213ca
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 28 16:41:32 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Feb 28 11:41:43 2019 -0500

    Merge topic 'features-from-default-standard'
    
    c7213ca870 Features: Do not use a lower-than-default standard for requested features
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3023


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a490ea4a2854a4c08f01b34bd444333e1bdbdc76
commit a490ea4a2854a4c08f01b34bd444333e1bdbdc76
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Feb 27 11:58:06 2019 +0100
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Feb 27 13:25:22 2019 +0100

    cmGeneratorExpressionNode: Initialize node key map in class constructor
    
    By initializing the node map in the class constructor of the static instance
    we avoid an if-empty check.

diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 49a5fcd..ce308cc 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -2058,75 +2058,76 @@ static const struct ShellPathNode : public cmGeneratorExpressionNode
 const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
   const std::string& identifier)
 {
-  typedef std::map<std::string, const cmGeneratorExpressionNode*> NodeMap;
-  static NodeMap nodeMap;
-  if (nodeMap.empty()) {
-    nodeMap["0"] = &zeroNode;
-    nodeMap["1"] = &oneNode;
-    nodeMap["AND"] = &andNode;
-    nodeMap["OR"] = &orNode;
-    nodeMap["NOT"] = ¬Node;
-    nodeMap["C_COMPILER_ID"] = &cCompilerIdNode;
-    nodeMap["CXX_COMPILER_ID"] = &cxxCompilerIdNode;
-    nodeMap["Fortran_COMPILER_ID"] = &fortranCompilerIdNode;
-    nodeMap["VERSION_GREATER"] = &versionGreaterNode;
-    nodeMap["VERSION_GREATER_EQUAL"] = &versionGreaterEqNode;
-    nodeMap["VERSION_LESS"] = &versionLessNode;
-    nodeMap["VERSION_LESS_EQUAL"] = &versionLessEqNode;
-    nodeMap["VERSION_EQUAL"] = &versionEqualNode;
-    nodeMap["C_COMPILER_VERSION"] = &cCompilerVersionNode;
-    nodeMap["CXX_COMPILER_VERSION"] = &cxxCompilerVersionNode;
-    nodeMap["Fortran_COMPILER_VERSION"] = &fortranCompilerVersionNode;
-    nodeMap["PLATFORM_ID"] = &platformIdNode;
-    nodeMap["COMPILE_FEATURES"] = &compileFeaturesNode;
-    nodeMap["CONFIGURATION"] = &configurationNode;
-    nodeMap["CONFIG"] = &configurationTestNode;
-    nodeMap["TARGET_FILE"] = &targetNodeGroup.File;
-    nodeMap["TARGET_LINKER_FILE"] = &targetLinkerNodeGroup.File;
-    nodeMap["TARGET_SONAME_FILE"] = &targetSoNameNodeGroup.File;
-    nodeMap["TARGET_PDB_FILE"] = &targetPdbNodeGroup.File;
-    nodeMap["TARGET_FILE_NAME"] = &targetNodeGroup.FileName;
-    nodeMap["TARGET_LINKER_FILE_NAME"] = &targetLinkerNodeGroup.FileName;
-    nodeMap["TARGET_SONAME_FILE_NAME"] = &targetSoNameNodeGroup.FileName;
-    nodeMap["TARGET_PDB_FILE_NAME"] = &targetPdbNodeGroup.FileName;
-    nodeMap["TARGET_FILE_DIR"] = &targetNodeGroup.FileDir;
-    nodeMap["TARGET_LINKER_FILE_DIR"] = &targetLinkerNodeGroup.FileDir;
-    nodeMap["TARGET_SONAME_FILE_DIR"] = &targetSoNameNodeGroup.FileDir;
-    nodeMap["TARGET_PDB_FILE_DIR"] = &targetPdbNodeGroup.FileDir;
-    nodeMap["TARGET_BUNDLE_DIR"] = &targetBundleDirNode;
-    nodeMap["TARGET_BUNDLE_CONTENT_DIR"] = &targetBundleContentDirNode;
-    nodeMap["STREQUAL"] = &strEqualNode;
-    nodeMap["EQUAL"] = &equalNode;
-    nodeMap["IN_LIST"] = &inListNode;
-    nodeMap["LOWER_CASE"] = &lowerCaseNode;
-    nodeMap["UPPER_CASE"] = &upperCaseNode;
-    nodeMap["MAKE_C_IDENTIFIER"] = &makeCIdentifierNode;
-    nodeMap["BOOL"] = &boolNode;
-    nodeMap["IF"] = &ifNode;
-    nodeMap["ANGLE-R"] = &angle_rNode;
-    nodeMap["COMMA"] = &commaNode;
-    nodeMap["SEMICOLON"] = &semicolonNode;
-    nodeMap["TARGET_PROPERTY"] = &targetPropertyNode;
-    nodeMap["TARGET_NAME"] = &targetNameNode;
-    nodeMap["TARGET_OBJECTS"] = &targetObjectsNode;
-    nodeMap["TARGET_POLICY"] = &targetPolicyNode;
-    nodeMap["TARGET_EXISTS"] = &targetExistsNode;
-    nodeMap["TARGET_NAME_IF_EXISTS"] = &targetNameIfExistsNode;
-    nodeMap["TARGET_GENEX_EVAL"] = &targetGenexEvalNode;
-    nodeMap["GENEX_EVAL"] = &genexEvalNode;
-    nodeMap["BUILD_INTERFACE"] = &buildInterfaceNode;
-    nodeMap["INSTALL_INTERFACE"] = &installInterfaceNode;
-    nodeMap["INSTALL_PREFIX"] = &installPrefixNode;
-    nodeMap["JOIN"] = &joinNode;
-    nodeMap["LINK_ONLY"] = &linkOnlyNode;
-    nodeMap["COMPILE_LANGUAGE"] = &languageNode;
-    nodeMap["SHELL_PATH"] = &shellPathNode;
-  }
-  NodeMap::const_iterator i = nodeMap.find(identifier);
-  if (i == nodeMap.end()) {
-    return nullptr;
+  static std::map<std::string, cmGeneratorExpressionNode const*> const nodeMap{
+    { "0", &zeroNode },
+    { "1", &oneNode },
+    { "AND", &andNode },
+    { "OR", &orNode },
+    { "NOT", &notNode },
+    { "C_COMPILER_ID", &cCompilerIdNode },
+    { "CXX_COMPILER_ID", &cxxCompilerIdNode },
+    { "Fortran_COMPILER_ID", &fortranCompilerIdNode },
+    { "VERSION_GREATER", &versionGreaterNode },
+    { "VERSION_GREATER_EQUAL", &versionGreaterEqNode },
+    { "VERSION_LESS", &versionLessNode },
+    { "VERSION_LESS_EQUAL", &versionLessEqNode },
+    { "VERSION_EQUAL", &versionEqualNode },
+    { "C_COMPILER_VERSION", &cCompilerVersionNode },
+    { "CXX_COMPILER_VERSION", &cxxCompilerVersionNode },
+    { "Fortran_COMPILER_VERSION", &fortranCompilerVersionNode },
+    { "PLATFORM_ID", &platformIdNode },
+    { "COMPILE_FEATURES", &compileFeaturesNode },
+    { "CONFIGURATION", &configurationNode },
+    { "CONFIG", &configurationTestNode },
+    { "TARGET_FILE", &targetNodeGroup.File },
+    { "TARGET_LINKER_FILE", &targetLinkerNodeGroup.File },
+    { "TARGET_SONAME_FILE", &targetSoNameNodeGroup.File },
+    { "TARGET_PDB_FILE", &targetPdbNodeGroup.File },
+    { "TARGET_FILE_NAME", &targetNodeGroup.FileName },
+    { "TARGET_LINKER_FILE_NAME", &targetLinkerNodeGroup.FileName },
+    { "TARGET_SONAME_FILE_NAME", &targetSoNameNodeGroup.FileName },
+    { "TARGET_PDB_FILE_NAME", &targetPdbNodeGroup.FileName },
+    { "TARGET_FILE_DIR", &targetNodeGroup.FileDir },
+    { "TARGET_LINKER_FILE_DIR", &targetLinkerNodeGroup.FileDir },
+    { "TARGET_SONAME_FILE_DIR", &targetSoNameNodeGroup.FileDir },
+    { "TARGET_PDB_FILE_DIR", &targetPdbNodeGroup.FileDir },
+    { "TARGET_BUNDLE_DIR", &targetBundleDirNode },
+    { "TARGET_BUNDLE_CONTENT_DIR", &targetBundleContentDirNode },
+    { "STREQUAL", &strEqualNode },
+    { "EQUAL", &equalNode },
+    { "IN_LIST", &inListNode },
+    { "LOWER_CASE", &lowerCaseNode },
+    { "UPPER_CASE", &upperCaseNode },
+    { "MAKE_C_IDENTIFIER", &makeCIdentifierNode },
+    { "BOOL", &boolNode },
+    { "IF", &ifNode },
+    { "ANGLE-R", &angle_rNode },
+    { "COMMA", &commaNode },
+    { "SEMICOLON", &semicolonNode },
+    { "TARGET_PROPERTY", &targetPropertyNode },
+    { "TARGET_NAME", &targetNameNode },
+    { "TARGET_OBJECTS", &targetObjectsNode },
+    { "TARGET_POLICY", &targetPolicyNode },
+    { "TARGET_EXISTS", &targetExistsNode },
+    { "TARGET_NAME_IF_EXISTS", &targetNameIfExistsNode },
+    { "TARGET_GENEX_EVAL", &targetGenexEvalNode },
+    { "GENEX_EVAL", &genexEvalNode },
+    { "BUILD_INTERFACE", &buildInterfaceNode },
+    { "INSTALL_INTERFACE", &installInterfaceNode },
+    { "INSTALL_PREFIX", &installPrefixNode },
+    { "JOIN", &joinNode },
+    { "LINK_ONLY", &linkOnlyNode },
+    { "COMPILE_LANGUAGE", &languageNode },
+    { "SHELL_PATH", &shellPathNode }
+  };
+
+  {
+    auto itr = nodeMap.find(identifier);
+    if (itr != nodeMap.end()) {
+      return itr->second;
+    }
   }
-  return i->second;
+  return nullptr;
 }
 
 void reportError(cmGeneratorExpressionContext* context,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7213ca87064ba47984b4dd07192389366d5856a
commit c7213ca87064ba47984b4dd07192389366d5856a
Author:     Zsolt Parragi <zsolt.parragi at cancellar.hu>
AuthorDate: Tue Feb 26 14:36:11 2019 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 26 14:35:55 2019 -0500

    Features: Do not use a lower-than-default standard for requested features
    
    `AddRequiredTargetC(xx)` feature didn't take the default compiler
    standard into account, which possibly resulted in the use of an older
    standard when some features requested it.
    
    Fixes: #18686

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a0b09da..ab37774 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4725,6 +4725,13 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
                                needCxx17, needCxx20);
 
   const char* existingCxxStandard = target->GetProperty("CXX_STANDARD");
+  if (existingCxxStandard == nullptr) {
+    const char* defaultCxxStandard =
+      this->GetDefinition("CMAKE_CXX_STANDARD_DEFAULT");
+    if (defaultCxxStandard && *defaultCxxStandard) {
+      existingCxxStandard = defaultCxxStandard;
+    }
+  }
   const char* const* existingCxxLevel = nullptr;
   if (existingCxxStandard) {
     existingCxxLevel =
@@ -4827,6 +4834,13 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
   this->CheckNeededCLanguage(feature, needC90, needC99, needC11);
 
   const char* existingCStandard = target->GetProperty("C_STANDARD");
+  if (existingCStandard == nullptr) {
+    const char* defaultCStandard =
+      this->GetDefinition("CMAKE_C_STANDARD_DEFAULT");
+    if (defaultCStandard && *defaultCStandard) {
+      existingCStandard = defaultCStandard;
+    }
+  }
   if (existingCStandard) {
     if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS),
                      cmStrCmp(existingCStandard)) == cm::cend(C_STANDARDS)) {
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index b0bc656..6ccdcc3 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -338,11 +338,11 @@ else()
 
   add_executable(CompileFeaturesGenex2 genex_test.cpp)
   target_compile_features(CompileFeaturesGenex2 PRIVATE cxx_std_11)
-  target_compile_definitions(CompileFeaturesGenex2 PRIVATE ${genex_test_defs})
+  target_compile_definitions(CompileFeaturesGenex2 PRIVATE ${genex_test_defs} ALLOW_LATER_STANDARDS=1)
 
   add_library(std_11_iface INTERFACE)
   target_compile_features(std_11_iface INTERFACE cxx_std_11)
   add_executable(CompileFeaturesGenex3 genex_test.cpp)
   target_link_libraries(CompileFeaturesGenex3 PRIVATE std_11_iface)
-  target_compile_definitions(CompileFeaturesGenex3 PRIVATE ${genex_test_defs})
+  target_compile_definitions(CompileFeaturesGenex3 PRIVATE ${genex_test_defs} ALLOW_LATER_STANDARDS=1)
 endif()
diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp
index 59f9006..4539789 100644
--- a/Tests/CompileFeatures/genex_test.cpp
+++ b/Tests/CompileFeatures/genex_test.cpp
@@ -15,10 +15,10 @@
 #  if !HAVE_CXX_STD_11
 #    error HAVE_CXX_STD_11 is false with CXX_STANDARD == 11
 #  endif
-#  if HAVE_CXX_STD_14
+#  if HAVE_CXX_STD_14 && !defined(ALLOW_LATER_STANDARDS)
 #    error HAVE_CXX_STD_14 is true with CXX_STANDARD == 11
 #  endif
-#  if HAVE_CXX_STD_17
+#  if HAVE_CXX_STD_17 && !defined(ALLOW_LATER_STANDARDS)
 #    error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11
 #  endif
 #endif

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGeneratorExpressionNode.cxx | 137 ++++++++++++++++++-----------------
 Source/cmMakefile.cxx                |  14 ++++
 Tests/CompileFeatures/CMakeLists.txt |   4 +-
 Tests/CompileFeatures/genex_test.cpp |   4 +-
 4 files changed, 87 insertions(+), 72 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list