Skip to content

Commit

Permalink
Merge pull request #3039 from eli-schwartz/meson
Browse files Browse the repository at this point in the history
Meson fixups for Windows
  • Loading branch information
Cyan4973 authored Apr 19, 2022
2 parents f1faab6 + c01582d commit 66633f9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ matrix:
- make -C tests versionsTest

# meson dedicated test
- name: Xenial (Meson + clang) # ~15mn
dist: bionic
- name: Focal (Meson + clang) # ~15mn
dist: focal
language: cpp
compiler: clang
install:
Expand Down
3 changes: 2 additions & 1 deletion build/meson/lib/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ libzstd_c_args = []
if cc_id == compiler_msvc
if default_library_type != 'static'
libzstd_sources += [windows_mod.compile_resources(
join_paths(zstd_rootdir, 'build/VS2010/libzstd-dll/libzstd-dll.rc'))]
join_paths(zstd_rootdir, 'build/VS2010/libzstd-dll/libzstd-dll.rc'),
include_directories: libzstd_includes)]
libzstd_c_args += ['-DZSTD_DLL_EXPORT=1',
'-DZSTD_HEAPMODE=0',
'-D_CONSOLE',
Expand Down
2 changes: 1 addition & 1 deletion build/meson/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ feature_lz4 = get_option('lz4')
# Dependencies
# =============================================================================

libm_dep = cc.find_library('m', required: bin_tests)
libm_dep = cc.find_library('m', required: false)
thread_dep = dependency('threads', required: feature_multi_thread)
use_multi_thread = thread_dep.found()
# Arguments in dependency should be equivalent to those passed to pkg-config
Expand Down
3 changes: 2 additions & 1 deletion build/meson/programs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ endif
if cc_id == compiler_msvc
if default_library_type != 'static'
zstd_programs_sources += [windows_mod.compile_resources(
join_paths(zstd_rootdir, 'build/VS2010/zstd/zstd.rc'))]
join_paths(zstd_rootdir, 'build/VS2010/zstd/zstd.rc'),
include_directories: libzstd_includes)]
endif
endif

Expand Down
10 changes: 5 additions & 5 deletions build/meson/tests/valgrindTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench):

if subprocess.call([*VALGRIND_ARGS, zstd],
stdout=subprocess.DEVNULL) == 0:
raise subprocess.CalledProcessError('zstd without argument should have failed')
raise subprocess.SubprocessError('zstd without argument should have failed')

with subprocess.Popen([datagen, '-g80'], stdout=subprocess.PIPE) as p1, \
subprocess.Popen([*VALGRIND_ARGS, zstd, '-', '-c'],
Expand All @@ -30,7 +30,7 @@ def valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench):
p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
p2.communicate()
if p2.returncode != 0:
raise subprocess.CalledProcessError()
raise subprocess.SubprocessError()

with subprocess.Popen([datagen, '-g16KB'], stdout=subprocess.PIPE) as p1, \
subprocess.Popen([*VALGRIND_ARGS, zstd, '-vf', '-', '-c'],
Expand All @@ -39,7 +39,7 @@ def valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench):
p1.stdout.close()
p2.communicate()
if p2.returncode != 0:
raise subprocess.CalledProcessError()
raise subprocess.SubprocessError()

with tempfile.NamedTemporaryFile() as tmp_fd:
with subprocess.Popen([datagen, '-g2930KB'], stdout=subprocess.PIPE) as p1, \
Expand All @@ -48,7 +48,7 @@ def valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench):
p1.stdout.close()
p2.communicate()
if p2.returncode != 0:
raise subprocess.CalledProcessError()
raise subprocess.SubprocessError()

subprocess.check_call([*VALGRIND_ARGS, zstd, '-vdf', tmp_fd.name, '-c'],
stdout=subprocess.DEVNULL)
Expand All @@ -60,7 +60,7 @@ def valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench):
p1.stdout.close()
p2.communicate()
if p2.returncode != 0:
raise subprocess.CalledProcessError()
raise subprocess.SubprocessError()

subprocess.check_call([*VALGRIND_ARGS, fuzzer, '-T1mn', '-t1'])
subprocess.check_call([*VALGRIND_ARGS, fullbench, '-i1'])
Expand Down

0 comments on commit 66633f9

Please sign in to comment.