Skip to content

Commit

Permalink
subprojects: fix --wrap-mode=forcefallback
Browse files Browse the repository at this point in the history
CMake wraps are not supported properly:
mesonbuild/meson#7943
  • Loading branch information
MrAnno committed Apr 30, 2023
1 parent 8d47174 commit 2c5621a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ klib = dependency('klib')

threads = dependency('threads')

nanomsg = dependency('nanomsg', required: false)
if not nanomsg.found()
nanomsg_proj = cmake.subproject('nanomsg',
nanomsg = dependency('nanomsg', required: get_option('wrap_mode') == 'nofallback')
if (not nanomsg.found()
or get_option('wrap_mode') == 'forcefallback'
or 'nanomsg' in get_option('force_fallback_for'))
nanomsg_proj = cmake.subproject('nanomsg-cmake',
cmake_options: [
'-DNN_TESTS=OFF',
'-DNN_TOOLS=OFF',
Expand All @@ -173,10 +175,13 @@ else
config.set('NN_REQREP_H', '<nanomsg/reqrep.h>')
endif

nanopb = dependency('nanopb', required: false, method: 'cmake', modules: ['nanopb::protobuf-nanopb-static'])
nanopb = dependency('nanopb', required: get_option('wrap_mode') == 'nofallback', method: 'cmake',
modules: ['nanopb::protobuf-nanopb-static'])
must_regenerate_pb = nanopb.found()
if not nanopb.found()
nanopb_proj = cmake.subproject('nanopb',
if (not nanopb.found()
or get_option('wrap_mode') == 'forcefallback'
or 'nanopb' in get_option('force_fallback_for'))
nanopb_proj = cmake.subproject('nanopb-cmake',
cmake_options: [
'-Dnanopb_BUILD_GENERATOR=OFF',
'-DBUILD_SHARED_LIBS=OFF',
Expand All @@ -186,9 +191,11 @@ if not nanopb.found()
nanopb = nanopb_proj.dependency('protobuf-nanopb-static')
endif

libgit2 = dependency('libgit2', required: false)
if not libgit2.found() and get_option('diffs').enabled()
libgit2_proj = cmake.subproject('libgit2',
libgit2 = dependency('libgit2', required: get_option('wrap_mode') == 'nofallback')
if ((not libgit2.found() and get_option('diffs').enabled())
or get_option('wrap_mode') == 'forcefallback'
or 'libgit2' in get_option('force_fallback_for'))
libgit2_proj = cmake.subproject('libgit2-cmake',
cmake_options: [
'-DBUILD_SHARED_LIBS=OFF',
'-DBUILD_CLAR=OFF',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2c5621a

Please sign in to comment.