Deprecate 'cppflags' in favor of 'cxxflags' in class CppInfo #4611
Changelog: Fix: Deprecate 'cppflags' in favor of 'cxxflags' in class CppInfo
In order to remove all the usages of the deprecated member in our codebase, I find one problem: the files written by the generators...
For example, the
and the expected (for Conan v2.0) should be:
During the transition, we can output something like the following one, to keep compatibility:
[cppflags_Hello] FLAG [cxxflags_Hello] FLAG
So, our reader should be able to deal with the first option and the last one until Conan V2 (checking that both sections contain the same information). This is easy for the
Maybe we can merge this PR jsut with the deprecation notice as the issue states, and then we can open a different PR to fix all the usages of this deprecated code. WDYT?
The text was updated successfully, but these errors were encountered:
I would like to use the approach recommended by the
""" TODO: Need to solve the circular dependency when importing `conans.__version__` in build_info.py @deprecation.fail_if_not_remove def test_deprecation_v2(self): cpp_info = CppInfo("roothpath") self.assertListEqual(cpp_info.cppflags, ) """ def test_deprecation_v2(self): cpp_info = CppInfo("roothpath") import warnings from conans import __version__ from packaging import version if version.parse(__version__) >= version.parse("2.0"): with warnings.catch_warnings(record=True) as caught_warnings: warnings.simplefilter("always") self.assertListEqual(cpp_info.cppflags, ) if caught_warnings: self.fail("CppInfo::cppflags must be removed in Conan 2.0")
Other option is to move