Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: ignore MSB warnings #3109

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions recipes/cmake/3.x.x/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 8 additions & 2 deletions recipes/cmake/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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])
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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 "[^\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.
Original file line number Diff line number Diff line change
@@ -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 "[^\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.