dependencies/ui: Honor static argument with wxwidgets
Fixes
@@ -538,10 +538,22 @@ class WxDependency(ConfigToolDependency):
if not self.is_found:
return
self.requested_modules = self.get_requested(kwargs)
+
+ extra_args = []
+ if self.static:
+ extra_args.append('--static=yes')
+
+ # Check to make sure static is going to work
+ err = Popen_safe(self.config + extra_args)[2]
+ if 'No config found to match' in err:
+ mlog.debug('WxWidgets is missing static libraries.')
+ self.is_found = False
+ return
+
# wx-config seems to have a cflags as well but since it requires C++,
# this should be good, at least for now.
- self.compile_args = self.get_config_value(['--cxxflags'] + self.requested_modules, 'compile_args')
- self.link_args = self.get_config_value(['--libs'] + self.requested_modules, 'link_args')
+ self.compile_args = self.get_config_value(['--cxxflags'] + extra_args + self.requested_modules, 'compile_args')
+ self.link_args = self.get_config_value(['--libs'] + extra_args + self.requested_modules, 'link_args')
@staticmethod
def get_requested(kwargs: T.Dict[str, T.Any]) -> T.List[str]:
