GithubHelp home page GithubHelp logo

Comments (4)

luboslenco avatar luboslenco commented on April 28, 2024 1

can you try building it on Windows with Clang?

Thanks for the tip!

  • I installed C++ Clang tools for Windows (16.0.5 - x64/x86) via Visual Studio Installer

  • Used the following commands to build:

cmake -S hermes -B build -G 'Visual Studio 17 2022' -T ClangCL -A x64
cmake --build ./build
  • This leads to errors / warnings:
clang-cl : warning : unknown argument ignored in clang-cl: '-fvisibility=hidden' [-Wunknown-argument]
clang-cl : warning : unknown argument ignored in clang-cl: '-fno-strict-overflow' [-Wunknown-argument]
clang-cl : warning : unknown argument ignored in clang-cl: '-fno-exceptions' [-Wunknown-argument]
clang-cl : warning : unknown argument ignored in clang-cl: '-fno-rtti' [-Wunknown-argument]
hermes\lib\IR\IR.cpp(574,17): error : 'operator delete' is a private member of 'hermes::Value'
hermes\lib\VM\StaticH.cpp(328,3): error : use of undeclared identifier '_longjmp'; did you mean 'longjmp'?
  • The hacky way I got past these (just for testing):

    • Modified CMakeLists.txt to use MSVC sections instead of GCC_COMPATIBLE
    • In lib/VM/StaticH.cpp replaced _longjmp with longjmp
    • In shermes/compile.cpp commented out #include <dlfcn.h> and dlopen() call, removed dl lib from shermes/CMakeLists.txt
  • Now the binaries and libs compile successfully

  • Set the cc env variable and pointed it to clang.exe

  • Used .\shermes.exe -c -typed .\test.ts to produce test.o

  • Linked test.o with my project together with hermesvm_a.lib and jsi.lib

  • Finally I call the main() function contained in test.o and it works!

from hermes.

tmikov avatar tmikov commented on April 28, 2024 1

@luboslenco great! Nice job!! It is very good to know that it can build and even run!

We need to figure out how to automatically detect this particular configuration - Clang on Windows with MSVC-compatible CLI, but there shouldn't be any major problems, since Hermes itself compiles and is widely used on Windows.

I don't think we will add it to our CI just yet, but we likely will before the middle of the year.

from hermes.

luboslenco avatar luboslenco commented on April 28, 2024 1

Just a side note, with mostly straightforward build tweaks I was able to run Static Hermes on Android, iOS, Windows (+ macOS and Linux). 🙂

from hermes.

tmikov avatar tmikov commented on April 28, 2024

Hi, this is a very good question. Static Hermes will support Windows but only via Clang, not MSVC. Since Static Hermes will rely on LLVM as a backend, the C output is just temporary, so it is not really worth it to support building the compiler with MSVC, when everything else (including parts of the Static Hermes runtime itself, which are written in JS) relies on LLVM.

This is not set in stone, but is the plan for now.

EDIT: can you try building it on Windows with Clang?

from hermes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.