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

Instructions to build with MSVC #45

Open
roman-orekhov opened this issue Apr 27, 2024 · 0 comments
Open

Instructions to build with MSVC #45

roman-orekhov opened this issue Apr 27, 2024 · 0 comments

Comments

@roman-orekhov
Copy link

Maybe this will save someone some headache

  1. Get python version 3 in PATH. I just happened to have 3.11, no issues
  2. Get meson. Docs don't specify the version but the project won't build with version <0.64.
    For this I used vcpkg from Git Bash:
    cd /c/vcpkg
    git pull
    ./bootstrap-vcpkg.sh
    # if you have one installed but it is old
    ./vcpkg remove vcpkg-tool-meson --recurse
    ./vcpkg install vcpkg-tool-meson
  3. Do not use libffi from vcpkg since it is a DLL not a static lib
  4. Make cffi/deps folder and put whatever the docs say you need to put there. I've put this tree there
    lua53.dll
    lua53.lib
    lua53.exe
    include\lauxlib.h
    include\lua.h
    include\luaconf.h
    include\lualib.h
    include\lua.hpp
  5. mkdir cffi/build
  6. Now open a developer command prompt from Visual Studio in this folder and do this for default buildtype (debugoptimized). Use your paths. Git is needed to grab libffi. --skip-subprojects is needed to not install it since it is a static lib.
    set PATH=C:\Work\Tools\Git\bin;%PATH%
    python c:\vcpkg\downloads\tools\meson-1.3.2-d646d3\meson.py setup .. -Dlua_version=vendor -Dlua_install_path=c:\Work\Tools\qlua\lib\lua\@0@\debug
    ninja all
    ninja test
    python c:\vcpkg\downloads\tools\meson-1.3.2-d646d3\meson.py install --skip-subprojects
  7. This got installed
    Installing cffi.dll to c:\Work\Tools\qlua\lib\lua\5.3\debug
    Installing cffi.lib to c:\Work\Tools\qlua\lib\lua\5.3\debug
    Installing cffi.pdb to c:\Work\Tools\qlua\lib\lua\5.3\debug
    
  8. For a release build do this instead:
    set PATH=C:\Work\Tools\Git\bin;%PATH%
    python c:\vcpkg\downloads\tools\meson-1.3.2-d646d3\meson.py setup .. -Dlua_version=vendor -Dlua_install_path=c:\Work\Tools\qlua\lib\lua\@0@ -Dbuildtype=release
    ninja all
    ninja test
    python c:\vcpkg\downloads\tools\meson-1.3.2-d646d3\meson.py install --tags runtime
  9. This will get installed Installing cffi.dll to c:\Work\Tools\qlua\lib\lua\5.3
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

1 participant