@@ -21,10 +21,12 @@ class FlacConan(ConanFile):
2121 options = {
2222 "shared" : [True , False ],
2323 "fPIC" : [True , False ],
24+ "with_cxxlibs" : [True , False ],
2425 }
2526 default_options = {
2627 "shared" : False ,
2728 "fPIC" : True ,
29+ "with_cxxlibs" : True ,
2830 }
2931
3032 def export_sources (self ):
@@ -58,6 +60,7 @@ def generate(self):
5860 tc .variables ["BUILD_DOCS" ] = False
5961 tc .variables ["BUILD_PROGRAMS" ] = not is_apple_os (self ) or self .settings .os == "Macos"
6062 tc .variables ["BUILD_TESTING" ] = False
63+ tc .variables ["BUILD_CXXLIBS" ] = self .options .with_cxxlibs
6164 tc .cache_variables ["CMAKE_POLICY_DEFAULT_CMP0077" ] = "NEW"
6265 if Version (self .version ) < "1.3.4" :
6366 tc .cache_variables ["CMAKE_POLICY_VERSION_MINIMUM" ] = "3.5" # CMake 4 support
@@ -100,10 +103,11 @@ def package_info(self):
100103 self .cpp_info .components ["libflac" ].libs = ["FLAC" ]
101104 self .cpp_info .components ["libflac" ].requires = ["ogg::ogg" ]
102105
103- self .cpp_info .components ["libflac++" ].set_property ("cmake_target_name" , "FLAC::FLAC++" )
104- self .cpp_info .components ["libflac++" ].set_property ("pkg_config_name" , "flac++" )
105- self .cpp_info .components ["libflac++" ].libs = ["FLAC++" ]
106- self .cpp_info .components ["libflac++" ].requires = ["libflac" ]
106+ if self .options .with_cxxlibs :
107+ self .cpp_info .components ["libflac++" ].set_property ("cmake_target_name" , "FLAC::FLAC++" )
108+ self .cpp_info .components ["libflac++" ].set_property ("pkg_config_name" , "flac++" )
109+ self .cpp_info .components ["libflac++" ].libs = ["FLAC++" ]
110+ self .cpp_info .components ["libflac++" ].requires = ["libflac" ]
107111 if not self .options .shared :
108112 self .cpp_info .components ["libflac" ].defines = ["FLAC__NO_DLL" ]
109113 if self .settings .os in ["Linux" , "FreeBSD" ]:
0 commit comments