-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules/gnome.py: Fix generating .gir with latest Windows SDK #13392
base: master
Are you sure you want to change the base?
Conversation
e75acec
to
c7f6c3c
Compare
...when a Visual Studio-style compiler is being used. The scanner and dumper programs for gtkdoc and introspection will fail to link with an obscure undefined symbol '_guard_check_icall_$fo$' without an appropriate CRT cflag (i.e. /MD or /MDd for instance) specified, when the latest Windows SDK (10.0.26100.0 or later) is being used on Visual Studio 2019 at least. This will update the private _get_langs_compilers_flags() if a Visual Studio style compiler is being used, as indicated by the b_vscrt option. This applies the appropriate CRT cflag according to the build options so that this issue will be avoided.
c7f6c3c
to
eef7a2a
Compare
|
||
for lang, compiler in langs_compilers: | ||
if len(crt_cflags) == 0 and OptionKey('b_vscrt') in compiler.base_options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(crt_cflags) == 0 and OptionKey('b_vscrt') in compiler.base_options: | |
if not crt_cflags and OptionKey('b_vscrt') in compiler.base_options: |
# _guard_check_icall_$fo$ | ||
crt_val = state.environment.coredata.get_option(OptionKey('b_vscrt')) | ||
buildtype = state.environment.coredata.get_option(OptionKey('buildtype')) | ||
if isinstance(crt_val, str) and isinstance(buildtype, str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the isinstance()
check needed?
@@ -1157,6 +1166,8 @@ def generate_gir(self, state: 'ModuleState', args: T.Tuple[T.List[T.Union[Execut | |||
dep_cflags, dep_internal_ldflags, dep_external_ldflags, gi_includes, depends = \ | |||
self._get_dependencies_flags(deps, state, depends, use_gir_args=True) | |||
scan_cflags = [] | |||
if len(crt_cflags) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(crt_cflags) > 0: | |
if crt_cflags: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, if crt_flags
is a list, the check can be omitted.
@@ -1572,6 +1583,8 @@ def _get_build_args(self, c_args: T.List[str], inc_dirs: T.List[T.Union[str, bui | |||
compiler = state.environment.coredata.compilers[MachineChoice.HOST]['c'] | |||
|
|||
compiler_flags = self._get_langs_compilers_flags(state, [('c', compiler)]) | |||
if len(compiler_flags[3]) > 0: | |||
cflags.extend(compiler_flags[3]) # Apply CRT cflag first if necessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here, I think the check can be omitted.
...when a Visual Studio-style compiler is being used.
The dumper program will fail to link with an obscure undefined symbol 'guard_check_icall$fo$ ' without an appropriate CRT cflag (i.e. /MD or /MDd for instance) specified, when the latest Windows SDK (10.0.26100.0 or later) is being used on Visual Studio 2019 at least.
This applies the appropriate CRT cflag according to the build options during introspection scanning so that this issue will be avoided.