Skip to content

Commit d7d373d

Browse files
committed
build: fix deprecation warnings
1 parent 2c5621a commit d7d373d

File tree

2 files changed

+42
-36
lines changed

2 files changed

+42
-36
lines changed

meson.build

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ is_git_repo = run_command([isdir, '.git'], check: false).returncode() == 0
2323

2424
version = 'v' + meson.project_version()
2525
if git.found() and is_git_repo
26-
git_version = run_command([git.path(), 'describe', '--dirty', '--tags'], check: false).stdout().strip()
27-
branch = run_command([git.path(), 'rev-parse', '--abbrev-ref', 'HEAD'], check: false).stdout().strip()
26+
git_version = run_command([git.full_path(), 'describe', '--dirty', '--tags'], check: false).stdout().strip()
27+
branch = run_command([git.full_path(), 'rev-parse', '--abbrev-ref', 'HEAD'], check: false).stdout().strip()
2828
if branch == 'HEAD'
29-
branch = run_command([git.path(), 'rev-parse', 'HEAD'], check: false).stdout().strip()
29+
branch = run_command([git.full_path(), 'rev-parse', 'HEAD'], check: false).stdout().strip()
3030
endif
3131
if git_version != ''
3232
version = git_version
@@ -148,14 +148,16 @@ nanomsg = dependency('nanomsg', required: get_option('wrap_mode') == 'nofallback
148148
if (not nanomsg.found()
149149
or get_option('wrap_mode') == 'forcefallback'
150150
or 'nanomsg' in get_option('force_fallback_for'))
151-
nanomsg_proj = cmake.subproject('nanomsg-cmake',
152-
cmake_options: [
153-
'-DNN_TESTS=OFF',
154-
'-DNN_TOOLS=OFF',
155-
'-DNN_STATIC_LIB=ON',
156-
'-DBUILD_SHARED_LIBS=OFF',
157-
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
158-
])
151+
152+
nanomsg_opts = cmake.subproject_options()
153+
nanomsg_opts.add_cmake_defines({
154+
'NN_TESTS': false,
155+
'NN_TOOLS': false,
156+
'NN_STATIC_LIB': true,
157+
'BUILD_SHARED_LIBS': false,
158+
'CMAKE_POSITION_INDEPENDENT_CODE': true,
159+
})
160+
nanomsg_proj = cmake.subproject('nanomsg-cmake', options: nanomsg_opts)
159161
nanomsg = nanomsg_proj.dependency('nanomsg')
160162
# nanomsg has a bad include file hierarchy when used from source
161163
config.set('NN_H', '<src/nn.h>')
@@ -181,37 +183,41 @@ must_regenerate_pb = nanopb.found()
181183
if (not nanopb.found()
182184
or get_option('wrap_mode') == 'forcefallback'
183185
or 'nanopb' in get_option('force_fallback_for'))
184-
nanopb_proj = cmake.subproject('nanopb-cmake',
185-
cmake_options: [
186-
'-Dnanopb_BUILD_GENERATOR=OFF',
187-
'-DBUILD_SHARED_LIBS=OFF',
188-
'-DCMAKE_C_FLAGS=-DPB_ENABLE_MALLOC=1 -DPB_NO_PACKED_STRUCTS=1',
189-
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
190-
])
186+
187+
nanopb_opts = cmake.subproject_options()
188+
nanopb_opts.add_cmake_defines({
189+
'nanopb_BUILD_GENERATOR': false,
190+
'BUILD_SHARED_LIBS': false,
191+
'CMAKE_C_FLAGS': '-DPB_ENABLE_MALLOC=1 -DPB_NO_PACKED_STRUCTS=1',
192+
'CMAKE_POSITION_INDEPENDENT_CODE': true,
193+
})
194+
nanopb_proj = cmake.subproject('nanopb-cmake', options: nanopb_opts)
191195
nanopb = nanopb_proj.dependency('protobuf-nanopb-static')
192196
endif
193197

194198
libgit2 = dependency('libgit2', required: get_option('wrap_mode') == 'nofallback')
195199
if ((not libgit2.found() and get_option('diffs').enabled())
196200
or get_option('wrap_mode') == 'forcefallback'
197201
or 'libgit2' in get_option('force_fallback_for'))
198-
libgit2_proj = cmake.subproject('libgit2-cmake',
199-
cmake_options: [
200-
'-DBUILD_SHARED_LIBS=OFF',
201-
'-DBUILD_CLAR=OFF',
202-
'-DUSE_ICONV=OFF',
203-
'-DUSE_SSH=OFF',
204-
'-DUSE_GSSAPI=OFF',
205-
'-DUSE_OPENSSL=OFF',
206-
'-DVALGRIND=OFF',
207-
'-DCURL=OFF',
208-
'-DWINHTTP=OFF',
209-
'-DCMAKE_DISABLE_FIND_PACKAGE_HTTP_Parser=TRUE',
210-
'-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE',
211-
'-DCMAKE_DISABLE_FIND_PACKAGE_Iconv=TRUE',
212-
'-DCMAKE_DISABLE_FIND_PACKAGE_Security=TRUE',
213-
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
214-
])
202+
203+
libgit2_opts = cmake.subproject_options()
204+
libgit2_opts.add_cmake_defines({
205+
'BUILD_SHARED_LIBS': false,
206+
'BUILD_CLAR': false,
207+
'USE_ICONV': false,
208+
'USE_SSH': false,
209+
'USE_GSSAPI': false,
210+
'USE_OPENSSL': false,
211+
'VALGRIND': false,
212+
'CURL': false,
213+
'WINHTTP': false,
214+
'CMAKE_DISABLE_FIND_PACKAGE_HTTP_Parser': true,
215+
'CMAKE_DISABLE_FIND_PACKAGE_ZLIB': true,
216+
'CMAKE_DISABLE_FIND_PACKAGE_Iconv': true,
217+
'CMAKE_DISABLE_FIND_PACKAGE_Security': true,
218+
'CMAKE_POSITION_INDEPENDENT_CODE': true,
219+
})
220+
libgit2_proj = cmake.subproject('libgit2-cmake', options: libgit2_opts)
215221
libgit2 = libgit2_proj.dependency('git2')
216222
endif
217223

test/cram/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ if sh.found() and cram.found()
1919
test('cram tests', cram,
2020
timeout: 240,
2121
workdir: join_paths(meson.current_source_dir(), '..', '..'),
22-
args: ['--shell=' + sh.path(), 'test/cram'],
22+
args: ['--shell=' + sh.full_path(), 'test/cram'],
2323
env: env)
2424
endif

0 commit comments

Comments
 (0)