Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meson build fails on Windows/MSVC #2073

Closed
veloman-yunkan opened this issue Apr 6, 2020 · 1 comment
Closed

Meson build fails on Windows/MSVC #2073

veloman-yunkan opened this issue Apr 6, 2020 · 1 comment
Assignees

Comments

@veloman-yunkan
Copy link

veloman-yunkan commented Apr 6, 2020

Describe the bug
The meson build fails on Windows+MSVC configuration with the following error:

meson.build:124:5: ERROR: Unknown variable "enable_static_runtime".

Expected behavior
The build must pass

Desktop (please complete the following information):

  • OS: Windows
  • Compiler: MSVC
  • Build system Meson

Proposed fix

diff --git a/build/meson/meson.build b/build/meson/meson.build
index 121811e..970cf3c 100644
--- a/build/meson/meson.build
+++ b/build/meson/meson.build
@@ -68,6 +68,7 @@ zstd_docdir = join_paths(zstd_datadir, 'doc', meson.project_name())
 # Built-in options
 use_debug = get_option('debug')
 buildtype = get_option('buildtype')
+default_library_type = get_option('default_library')
 
 # Custom options
 debug_level = get_option('debug_level')
@@ -121,7 +122,7 @@ elif cc_id == compiler_msvc
   if use_multi_thread
     msvc_compile_flags += '/MP'
   endif
-  if enable_static_runtime
+  if use_static_runtime
     msvc_compile_flags += '/MT'
   endif
   add_project_arguments(msvc_compile_flags, language: ['c', 'cpp'])
veloman-yunkan added a commit to kiwix/kiwix-build that referenced this issue Apr 6, 2020
veloman-yunkan added a commit to kiwix/kiwix-build that referenced this issue Apr 6, 2020
veloman-yunkan added a commit to kiwix/kiwix-build that referenced this issue Apr 7, 2020
veloman-yunkan added a commit to kiwix/kiwix-build that referenced this issue Apr 7, 2020
veloman-yunkan added a commit to kiwix/kiwix-build that referenced this issue Apr 7, 2020
veloman-yunkan added a commit to kiwix/kiwix-build that referenced this issue Apr 7, 2020
@bimbashrestha
Copy link
Contributor

Thanks for filing the issue. I've managed to reproduce this bug on my machine:

$ meson builddir
...
Run-time dependency zlib found: YES 1.2.11
Run-time dependency liblzma found: YES 5.2.4
Run-time dependency liblz4 found: NO (tried pkgconfig and cmake)

meson.build:124:5: ERROR: Unknown variable "enable_static_runtime".

And I can confirm that your proposed changes fix the issue on my machine:
After patch

$ meson builddir
...
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:\python38\python.exe C:\Users\Bimba Shrestha\workspace\zstd1\build\meson\programs\../InstallSymlink.py)
Build targets in project: 5

I'll put up a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants