aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2022-02-11 03:49:17 +0100
committerMarvin Scholz <epirat07@gmail.com>2022-03-31 10:55:55 +0200
commit1b03441bc46819f098e935370294fa88a544d7d0 (patch)
tree9aea0383fbad29d403d106b9f3c6d949530c2697
parentf02ffc007c103189a3f80204676268f9a4429daa (diff)
downloadmeson-1b03441bc46819f098e935370294fa88a544d7d0.zip
meson-1b03441bc46819f098e935370294fa88a544d7d0.tar.gz
meson-1b03441bc46819f098e935370294fa88a544d7d0.tar.bz2
visualstudio: do not query underscore define with MSVC
MSVC does not has the builtin define to check for the symbol prefix, so do not try to query it at all, to save some time.
-rw-r--r--mesonbuild/compilers/mixins/visualstudio.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py
index 5118e41..2f26453 100644
--- a/mesonbuild/compilers/mixins/visualstudio.py
+++ b/mesonbuild/compilers/mixins/visualstudio.py
@@ -383,6 +383,23 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
def get_argument_syntax(self) -> str:
return 'msvc'
+ def symbols_have_underscore_prefix(self, env: 'Environment') -> bool:
+ '''
+ Check if the compiler prefixes an underscore to global C symbols.
+
+ This overrides the Clike method, as for MSVC checking the
+ underscore prefix based on the compiler define never works,
+ so do not even try.
+ '''
+ # Try to consult a hardcoded list of cases we know
+ # absolutely have an underscore prefix
+ result = self._symbols_have_underscore_prefix_list(env)
+ if result is not None:
+ return result
+
+ # As a last resort, try search in a compiled binary
+ return self._symbols_have_underscore_prefix_searchbin(env)
+
class MSVCCompiler(VisualStudioLikeCompiler):