summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-07-24 13:36:12 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2019-11-19 05:49:34 +0800
commite9db26898b8aae8737dddb11f5ba2abb6ec6ca5f (patch)
tree92726d0a61be91a09839195c85c8d64dd053a8b3
parentf251c12f8a64146ae698fc640b243c3d57450197 (diff)
downloadpixman-e9db26898b8aae8737dddb11f5ba2abb6ec6ca5f.tar.gz
meson.build: Disable OpenMP on MSVC builds
The implementation of OpenMP is not compliant for our uses, so disable it for now by just not checking for it on MSVC builds, as we implicitly add an /openmp switch to the build, which will cause linking the tests programs to fail, as the OpenMP implementation is not enough.
-rw-r--r--meson.build23
1 files changed, 15 insertions, 8 deletions
diff --git a/meson.build b/meson.build
index 966058c..8f062bc 100644
--- a/meson.build
+++ b/meson.build
@@ -365,14 +365,21 @@ if get_option('gnuplot')
config.set('PIXMAN_GNUPLOT', 1)
endif
-dep_openmp = dependency('openmp', required : get_option('openmp'))
-if dep_openmp.found()
- config.set10('USE_OPENMP', true)
-elif meson.version().version_compare('<0.51.0')
-# In versions of meson before 0.51 the openmp dependency can still
-# inject arguments in the the auto case when it is not found, the
-# detection does work correctly in that case however, so we just
-# replace dep_openmp with null_dep to work around this.
+if cc.get_id() != 'msvc'
+ dep_openmp = dependency('openmp', required : get_option('openmp'))
+ if dep_openmp.found()
+ config.set10('USE_OPENMP', true)
+ elif meson.version().version_compare('<0.51.0')
+ # In versions of meson before 0.51 the openmp dependency can still
+ # inject arguments in the the auto case when it is not found, the
+ # detection does work correctly in that case however, so we just
+ # replace dep_openmp with null_dep to work around this.
+ dep_openmp = null_dep
+ endif
+else
+ # the MSVC implementation of openmp is not compliant enough for our
+ # uses here, so we disable it here.
+ # Please see: https://stackoverflow.com/questions/12560243/using-threadprivate-directive-in-visual-studio
dep_openmp = null_dep
endif