From a18d8617fef8db46ad8e54d7502bbf83dcd450ba Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 5 Oct 2020 18:46:17 +0200 Subject: [PATCH 1/2] cmake: ignore MSB warnings --- recipes/cmake/3.x.x/conandata.yml | 46 +++++++++++++++++++ recipes/cmake/3.x.x/conanfile.py | 10 +++- .../3.16.x-0001-ignore-MSBXXX-warnings.patch | 11 +++++ .../3.17.0-0001-ignore-MSBXXX-warnings.patch | 11 +++++ 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch create mode 100644 recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch diff --git a/recipes/cmake/3.x.x/conandata.yml b/recipes/cmake/3.x.x/conandata.yml index d14b8785f1985..4510a08c2edb0 100644 --- a/recipes/cmake/3.x.x/conandata.yml +++ b/recipes/cmake/3.x.x/conandata.yml @@ -44,3 +44,49 @@ sources: "3.18.2": sha256: 5d4e40fc775d3d828c72e5c45906b4d9b59003c9433ff1b36a1cb552bbd51d7e url: https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2.tar.gz +patches: + "3.16.2": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.16.3": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.16.4": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.16.5": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.16.6": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.16.7": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.16.8": + - patch_file: "patches/3.16.x-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.17.0": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.17.1": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.17.2": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.17.3": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.17.4": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.18.0": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.18.1": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder + "3.18.2": + - patch_file: "patches/3.17.0-0001-ignore-MSBXXX-warnings.patch" + base_path: source_subfolder diff --git a/recipes/cmake/3.x.x/conanfile.py b/recipes/cmake/3.x.x/conanfile.py index e36f60d2502e5..009e91821e6d2 100644 --- a/recipes/cmake/3.x.x/conanfile.py +++ b/recipes/cmake/3.x.x/conanfile.py @@ -19,8 +19,12 @@ class CMakeConan(ConanFile): default_options = { "with_openssl": "auto", } + exports_sources = "patches/**" + + @property + def _source_subfolder(self): + return "source_subfolder" - _source_subfolder = "source_subfolder" _cmake = None def _minor_version(self): @@ -38,7 +42,7 @@ def configure(self): def requirements(self): if self._with_openssl: - self.requires("openssl/1.1.1g") + self.requires("openssl/1.1.1h") def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -57,6 +61,8 @@ def _configure_cmake(self): return self._cmake def build(self): + for patch in self.conan_data.get("patches", {}).get(self.version, []): + tools.patch(**patch) tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"), "project(CMake)", "project(CMake)\ninclude(\"{}/conanbuildinfo.cmake\")\nconan_basic_setup()".format( diff --git a/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch b/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch new file mode 100644 index 0000000000000..4727a5437a308 --- /dev/null +++ b/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch @@ -0,0 +1,11 @@ +--- Source/Checks/cm_cxx_features.cmake ++++ Source/Checks/cm_cxx_features.cmake +@@ -17,6 +17,8 @@ + set(check_output "${OUTPUT}") + # Filter out MSBuild output that looks like a warning. + string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}") ++ # Filter out MSBuild output that looks like a warning. ++ string(REGEX REPLACE " warning MSB[0-9]{4}" "" check_output "${check_output}") + # Filter out warnings caused by user flags. + string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") + # Filter out warnings caused by local configuration. diff --git a/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch b/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch new file mode 100644 index 0000000000000..6b108a320ee6d --- /dev/null +++ b/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch @@ -0,0 +1,11 @@ +--- Source/Checks/cm_cxx_features.cmake ++++ Source/Checks/cm_cxx_features.cmake +@@ -21,6 +21,8 @@ + set(check_output "${OUTPUT}") + # Filter out MSBuild output that looks like a warning. + string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}") ++ # Filter out MSBuild output that looks like a warning. ++ string(REGEX REPLACE " warning MSB[0-9]{4}" "" check_output "${check_output}") + # Filter out warnings caused by user flags. + string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") + # Filter out warnings caused by local configuration. From b92be03e162f811a072b05a3c27ef36e3017ad48 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 5 Oct 2020 19:54:21 +0200 Subject: [PATCH 2/2] cmake: fix MSB patch --- .../3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch | 2 +- .../3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch b/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch index 4727a5437a308..ff1798919cc2b 100644 --- a/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch +++ b/recipes/cmake/3.x.x/patches/3.16.x-0001-ignore-MSBXXX-warnings.patch @@ -5,7 +5,7 @@ # Filter out MSBuild output that looks like a warning. string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}") + # Filter out MSBuild output that looks like a warning. -+ string(REGEX REPLACE " warning MSB[0-9]{4}" "" check_output "${check_output}") ++ string(REGEX REPLACE "[^\n]*warning MSB[0-9][0-9][0-9][0-9][^\n]*" "" check_output "${check_output}") # Filter out warnings caused by user flags. string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") # Filter out warnings caused by local configuration. diff --git a/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch b/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch index 6b108a320ee6d..af677d1008458 100644 --- a/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch +++ b/recipes/cmake/3.x.x/patches/3.17.0-0001-ignore-MSBXXX-warnings.patch @@ -5,7 +5,7 @@ # Filter out MSBuild output that looks like a warning. string(REGEX REPLACE " +0 Warning\\(s\\)" "" check_output "${check_output}") + # Filter out MSBuild output that looks like a warning. -+ string(REGEX REPLACE " warning MSB[0-9]{4}" "" check_output "${check_output}") ++ string(REGEX REPLACE "[^\n]*warning MSB[0-9][0-9][0-9][0-9][^\n]*" "" check_output "${check_output}") # Filter out warnings caused by user flags. string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") # Filter out warnings caused by local configuration.