Skip to content
Snippets Groups Projects
Commit e9db2689 authored by Chun-wei Fan's avatar Chun-wei Fan
Browse files

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.
parent f251c12f
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment