Skip to content

Meson build fails on windows #2358

@o-mdr

Description

@o-mdr

Describe the bug
Meson build fails on Windows platform

To Reproduce
Steps to reproduce the behaviour:

  1. On Windows platform with MSVC tools run a developer command line (this comes with MS Visual Studio. NB: NOT vscode, but full VS)
  2. Download source code of zstd (main or release 1.4.5)
  3. In developer console execute first time setup
cd build\meson
meson setup builddir
---
C:\Users\om\Downloads\zstd-dev\build\meson>meson setup builddir
The Meson build system
Version: 0.55.3
Source dir: C:\Users\om\Downloads\zstd-dev\build\meson
Build dir: C:\Users\om\Downloads\zstd-dev\build\meson\builddir
Build type: native build
Project name: zstd
Project version: DUMMY
C compiler for the host machine: cl (msvc 19.27.29111)
C linker for the host machine: link link 14.27.29111.0
C++ compiler for the host machine: cl (msvc 19.27.29111)
C++ linker for the host machine: link link 14.27.29111.0
Host machine cpu family: x86
Host machine cpu: x86
Program GetZstdLibraryVersion.py found: YES
Message: Project version is now: 1.4.6
Library m found: NO
Run-time dependency threads found: YES
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Found CMake: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.EXE (3.17.20032601)
Run-time dependency zlib found: NO (tried pkgconfig and cmake)
Run-time dependency liblzma found: NO (tried pkgconfig and cmake)
Run-time dependency liblz4 found: NO (tried pkgconfig and cmake)
Message: Enable legacy support back to version 0.5
Message: Enable multi-threading support
Windows resource compiler: Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Program ../InstallSymlink.py found: YES (C:\Program Files\Meson\meson.exe runpython C:\Users\om\Downloads\zstd-dev\build\meson\programs\../InstallSymlink.py)
Build targets in project: 5

Found ninja-1.10.0 at "C:\Program Files\Meson\ninja.EXE"
  1. Compile code
meson compile -C builddir

---
C:\Users\om\Downloads\zstd-dev\build\meson>meson compile -C builddir
Found runner: ['C:\\Program Files\\Meson\\ninja.EXE']
ninja: Entering directory `builddir'
[1/52] Generating Windows resource for file 'lib_.._.._.._build_VS2010_libzstd-dll_libzstd-dll.rc' with a custom command
FAILED: lib/lib_.._.._.._build_VS2010_libzstd-dll_libzstd-dll.rc_libzstd-dll.res
"C:/Program Files (x86)/Windows Kits/10/bin/10.0.18362.0/x86/rc.EXE" "/nologo" "/folib/lib_.._.._.._build_VS2010_libzstd-dll_libzstd-dll.rc_libzstd-dll.res" "../lib/../../../build/VS2010/libzstd-dll/libzstd-dll.rc"
../lib/../../../build/VS2010/libzstd-dll/libzstd-dll.rc(4) : fatal error RC1015: cannot open include file 'zstd.h'.
[10/52] Compiling C object lib/zstd-1.dll.p/.._.._.._lib_common_fse_decompress.c.obj
ninja: build stopped: subcommand failed.

Expected behavior
Compilation should just work

Screenshots and charts
scr1

Desktop (please complete the following information):

  • OS: Windows x64
  • Version build 2004
  • Compiler msvc 19.27.29111
  • Flags: none, default build
  • Other relevant hardware specs: this works on Linux and Ubuntu (because that line is not hit)
  • Build system: Meson

Additional context
This seems to be because of the following:
Step 1. Meson build file calls a resource file and compiles it
Step 2. Resource file includes zstd.h on line 4, which fails.

Originally found when working on a patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions