Repository: conan-io/conan
Pull request #14252 (2023-07-08 19:24:21)

Add gcc 10.5
Changelog: Feature: Add GCC 10.5 to default settings.yml
Docs: Omit

I _think_ it's enough with this change unless I'm missing something

https://gcc.gnu.org/pipermail/gcc-announce/2023/000178.html



Patch:
diff --git a/conan/tools/cmake/cmake.py b/conan/tools/cmake/cmake.py
index d4cecdea8..b47a53ba5 100644
--- a/conan/tools/cmake/cmake.py
+++ b/conan/tools/cmake/cmake.py
@@ -188,6 +188,11 @@ class CMake(object):
         if component:
             arg_list.extend(["--component", component])
         arg_list.extend(self._compilation_verbosity_arg)
+
+        do_strip = self._conanfile.conf.get("tools.cmake:install_strip", check_type=bool)
+        if do_strip:
+            arg_list.append("--strip")
+
         arg_list = " ".join(filter(None, arg_list))
         command = "%s %s" % (self._cmake_program, arg_list)
         self._conanfile.run(command)
diff --git a/conans/client/conf/__init__.py b/conans/client/conf/__init__.py
index 420282f5b..c998202af 100644
--- a/conans/client/conf/__init__.py
+++ b/conans/client/conf/__init__.py
@@ -72,7 +72,7 @@ compiler:
                     "7", "7.1", "7.2", "7.3", "7.4", "7.5",
                     "8", "8.1", "8.2", "8.3", "8.4", "8.5",
                     "9", "9.1", "9.2", "9.3", "9.4", "9.5",
-                    "10", "10.1", "10.2", "10.3", "10.4",
+                    "10", "10.1", "10.2", "10.3", "10.4", "10.5",
                     "11", "11.1", "11.2", "11.3",
                     "12", "12.1", "12.2", "12.3",
                     "13", "13.1"]
diff --git a/conans/model/conf.py b/conans/model/conf.py
index a8261b3ad..52dd76d66 100644
--- a/conans/model/conf.py
+++ b/conans/model/conf.py
@@ -65,6 +65,7 @@ BUILT_IN_CONFS = {
     "tools.cmake.cmaketoolchain:toolset_arch": "Toolset architecture to be used as part of CMAKE_GENERATOR_TOOLSET in CMakeToolchain",
     "tools.cmake.cmake_layout:build_folder_vars": "Settings and Options that will produce a different build folder and different CMake presets names",
     "tools.cmake:cmake_program": "Path to CMake executable",
+    "tools.cmake:install_strip": "Add --strip to cmake.instal()",
     "tools.files.download:retry": "Number of retries in case of failure when downloading",
     "tools.files.download:retry_wait": "Seconds to wait between download attempts",
     "tools.gnu:make_program": "Indicate path to make program",


Test patch:
diff --git a/conans/test/unittests/tools/cmake/test_cmake_install.py b/conans/test/unittests/tools/cmake/test_cmake_install.py
index 0c05cf5e1..9d411f817 100644
--- a/conans/test/unittests/tools/cmake/test_cmake_install.py
+++ b/conans/test/unittests/tools/cmake/test_cmake_install.py
@@ -28,9 +28,38 @@ def test_run_install_component():
     conanfile.settings = settings
     conanfile.folders.set_base_package(temp_folder())
 
-    # Choose generator to match generic setttings
+    # Choose generator to match generic settings
     write_cmake_presets(conanfile, "toolchain", "Visual Studio 14 2015", {})
     cmake = CMake(conanfile)
     cmake.install(component="foo")
 
     assert "--component foo" in conanfile.command
+
+
+def test_run_install_strip():
+    """
+    Testing that the install/strip rule is called
+    Issue related: https://github.com/conan-io/conan/issues/14166
+    """
+
+    settings = Settings.loads(get_default_settings_yml())
+    settings.os = "Linux"
+    settings.arch = "x86_64"
+    settings.build_type = "Release"
+    settings.compiler = "gcc"
+    settings.compiler.version = "11"
+
+    conanfile = ConanFileMock()
+
+    conanfile.conf = Conf()
+    conanfile.conf.define("tools.cmake:install_strip", True)
+
+    conanfile.folders.generators = "."
+    conanfile.folders.set_base_generators(temp_folder())
+    conanfile.settings = settings
+    conanfile.folders.set_base_package(temp_folder())
+
+    write_cmake_presets(conanfile, "toolchain", "Unix Makefiles", {})
+    cmake = CMake(conanfile)
+    cmake.install()
+    assert "--strip" in conanfile.command