@@ -27,15 +27,16 @@ class ThorvgConan(ConanFile):
2727 options = {
2828 "shared" : [True , False ],
2929 "fPIC" : [True , False ],
30- "with_engines" : ['sw' , 'gl_beta' , 'wg_beta' , "gl " ],
31- "with_loaders" : [False , 'tvg' , ' svg' , 'png' , 'jpg' , 'lottie' , 'ttf' , 'webp' , 'all' ],
32- "with_savers" : [False , 'tvg' , ' gif' , 'all' ],
33- "with_bindings" : [False , 'capi' , 'wasm_beta' ],
34- "with_tools" : [False , 'svg2tvg' , ' svg2png' , 'lottie2gif' , 'all' ],
30+ "with_engines" : ['sw' , "gl" , "wg" , "all " ],
31+ "with_loaders" : [False , 'svg' , 'png' , 'jpg' , 'lottie' , 'ttf' , 'webp' , 'all' ],
32+ "with_savers" : [False , 'gif' , 'all' ],
33+ "with_bindings" : [False , 'capi' ],
34+ "with_tools" : [False , 'svg2png' , 'lottie2gif' , 'all' ],
3535 "with_threads" : [True , False ],
3636 "with_simd" : [True , False ],
37- "with_examples" : [True , False ],
38- "with_extra" : [False , 'lottie_expressions' ],
37+ "with_lottie_exp" : [False , True ],
38+ "with_openmp" : [False , True ],
39+ "with_gl_variant" : [False , True ],
3940 "with_file" : [True , False ],
4041 }
4142 default_options = {
@@ -48,8 +49,9 @@ class ThorvgConan(ConanFile):
4849 "with_tools" : False ,
4950 "with_threads" : True ,
5051 "with_simd" : False ,
51- "with_examples" : False ,
52- "with_extra" : 'lottie_expressions' ,
52+ "with_lottie_exp" : True ,
53+ "with_openmp" : True ,
54+ "with_gl_variant" : False ,
5355 "with_file" : True ,
5456 }
5557 # See more here: https://github.com/thorvg/thorvg/blob/main/meson_options.txt
@@ -61,8 +63,9 @@ class ThorvgConan(ConanFile):
6163 "with_simd" : "Enable CPU Vectorization(SIMD) in thorvg" ,
6264 "with_bindings" : "Enable API bindings" ,
6365 "with_tools" : "Enable building thorvg tools" ,
64- "with_examples" : "Enable building examples" ,
65- "with_extra" : "Enable support for exceptionally advanced features" ,
66+ "with_lottie_exp" : "Enable support for Lottie Expressions" ,
67+ "with_openmp" : "Enable support for OpenMP" ,
68+ "with_gl_variant" : "Enable support for OpenGL Variant" ,
6669 }
6770 short_paths = True
6871
@@ -83,8 +86,6 @@ def _compilers_minimum_version(self):
8386 def config_options (self ):
8487 if self .settings .os == "Windows" :
8588 del self .options .fPIC
86- if Version (self .version ) < "0.15.6" :
87- del self .options .with_file
8889
8990 def configure (self ):
9091 if self .options .shared :
@@ -107,11 +108,6 @@ def validate(self):
107108 f"{ self .ref } doesn't support debug build on MSVC."
108109 )
109110
110- if Version (self .version ) < "0.14.0" and self .options .with_engines in ["gl" ]:
111- raise ConanInvalidConfiguration (f"{ self .ref } doesn't support with_engines=gl, use with_engines=gl_beta instead" )
112- if Version (self .version ) >= "0.14.0" and self .options .with_engines in ["gl_beta" ]:
113- raise ConanInvalidConfiguration (f"{ self .ref } doesn't support with_engines=gl_beta, use with_engines=gl instead" )
114-
115111 def requirements (self ):
116112 loaders_opt = str (self .options .with_loaders )
117113 if loaders_opt in ("all" , "jpg" ):
@@ -121,7 +117,7 @@ def requirements(self):
121117 if loaders_opt in ("all" , "webp" ):
122118 self .requires ("libwebp/[>=1.4.0 <2]" )
123119 if self .settings .os == "Linux" :
124- if self .options .with_engines in [ "gl" , "gl_beta" ] :
120+ if self .options .with_engines == "gl" :
125121 self .requires ("opengl/system" )
126122
127123 def build_requirements (self ):
@@ -142,16 +138,22 @@ def generate(self):
142138 "bindings" : str (self .options .with_bindings ) if self .options .with_bindings else '' ,
143139 "tools" : str (self .options .with_tools )if self .options .with_tools else '' ,
144140 "threads" : bool (self .options .with_threads ),
145- "examples" : bool (self .options .with_examples ),
146141 "tests" : False ,
147142 "log" : is_debug ,
148143 })
149144 # Workaround to avoid: error D8016: '/O1' and '/RTC1' command-line options are incompatible
150145 if is_msvc (self ) and is_debug :
151146 tc .project_options ["optimization" ] = "plain"
152147 tc .project_options ["simd" ] = bool (self .options .with_simd )
153- if self .options .with_extra :
154- tc .project_options ["extra" ] = str (self .options .with_extra )
148+ extras = []
149+ if self .options .with_lottie_exp :
150+ extras .append ("lottie_exp" )
151+ if self .options .with_openmp :
152+ extras .append ("openmp" )
153+ if self .options .with_gl_variant :
154+ extras .append ("gl_variant" )
155+ if extras :
156+ tc .project_options ["extra" ] = "," .join (extras )
155157 if "with_file" in self .options :
156158 tc .project_options ["file" ] = self .options .with_file
157159 tc .generate ()
@@ -165,16 +167,6 @@ def _patch_sources(self):
165167 if is_msvc (self ) and self .options .shared :
166168 replace_in_file (self , os .path .join (self .source_folder , "meson.build" ), ", 'strip=true'" , "" )
167169
168- # TODO: As OpenMP is tagged as "required: false", let's disable it for now to avoid extra flags and requirements injections.
169- if Version (self .version ) >= "0.15.1" and self .options .with_threads :
170- # Notice that the use of disabler() is not working here. If it's used, there is no targets to build.
171- replace_in_file (self , os .path .join (self .source_folder , "src" , "renderer" , "sw_engine" , "meson.build" ),
172- "omp_dep = dependency('openmp', required: false)" ,
173- "omp_dep = []" )
174- replace_in_file (self , os .path .join (self .source_folder , "src" , "renderer" , "sw_engine" , "meson.build" ),
175- "omp_dep.found()" ,
176- "false" )
177-
178170 def build (self ):
179171 self ._patch_sources ()
180172 meson = Meson (self )
@@ -193,7 +185,7 @@ def package(self):
193185 rename (self , os .path .join (self .package_folder , "lib" , "libthorvg.a" ), os .path .join (self .package_folder , "lib" , "thorvg.lib" ))
194186
195187 def package_info (self ):
196- self .cpp_info .libs = ["thorvg" ]
188+ self .cpp_info .libs = ["thorvg-1 " ]
197189
198190 self .cpp_info .set_property ("pkg_config_name" , "libthorvg" )
199191 if self .settings .os in ["Linux" , "FreeBSD" ]:
0 commit comments