Skip to content

Commit

Permalink
Clear instead of header_only alternative (#11478)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Jun 17, 2022
1 parent 2ddd17f commit 22d083d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions conans/model/info.py
Expand Up @@ -575,11 +575,14 @@ def serialize_min(self):
"recipe_hash": self.recipe_hash}
return conan_info_json

# FIXME: Rename this to "clear" in 2.0
def header_only(self):
self.settings.clear()
self.options.clear()
self.requires.clear()

clear = header_only

def msvc_compatible(self):
if self.settings.compiler != "msvc":
return
Expand Down
Expand Up @@ -107,7 +107,7 @@ def test_transitive_second_level_header_only(self):
client.run("create . libb/1.0@")
# libC -> libB

unrelated = "self.info.header_only()"
unrelated = "self.info.clear()"
client.save({"conanfile.py": GenConanfile().with_require("libb/1.0")
.with_package_id(unrelated)})
client.run("create . libc/1.0@")
Expand Down
Expand Up @@ -18,7 +18,7 @@ def configure(self):
self.provides = 'libjpeg'
def package_info(self):
self.info.header_only()
self.info.clear()
""")

def test_conflict_requirement(self):
Expand Down

0 comments on commit 22d083d

Please sign in to comment.