Comments (4)
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 useMSVC
sections instead ofGCC_COMPATIBLE
- In
lib/VM/StaticH.cpp
replaced_longjmp
withlongjmp
- In
shermes/compile.cpp
commented out#include <dlfcn.h>
anddlopen()
call, removeddl
lib fromshermes/CMakeLists.txt
- Modified
-
Now the binaries and libs compile successfully
-
Set the
cc
env variable and pointed it toclang.exe
-
Used
.\shermes.exe -c -typed .\test.ts
to producetest.o
-
Linked
test.o
with my project together withhermesvm_a.lib
andjsi.lib
-
Finally I call the
main()
function contained intest.o
and it works!
from hermes.
@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.
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.
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)
- Compile failure with optimized ASan builds HOT 4
- Thread 6: "Exception NSException * "Unhandled JS Exception: Error: invalid host, js engine: hermes" HOT 32
- Parser: improve error message when await is used in non-async functions or instead of async
- JSRangeErrorException setting maximumFractionDigits to 0 with Intl.NumberFormat currency style HOT 1
- Unreachable in ES6 is reachable. HOT 1
- Update documentation on using custom Hermes builds HOT 5
- Problems finding libraries with fresh compile under windows HOT 3
- Conversion of large array to a Set seems slow HOT 5
- React Native & Hermes: Is Additional Code Obfuscation Beneficial? HOT 1
- Array.protoype.indexOf() Performance Regression HOT 3
- 'hermes-engine' uses the unencrypted 'http' protocol to transfer the Pod.
- hermes-eslint missing `__defineGeneric` in context `getScope` HOT 1
- Date constructor accept wrong ISO 8601 date HOT 2
- libc.so (SIGABRT, SIGSEGV) HOT 4
- Performance regression traversing large arrays compared to other engines HOT 4
- Hermes 0.7.2 : Max heap size was exceeded HOT 4
- hermes eslint: No sourceCode in context HOT 6
- Bug: recursion: "Maximum call stack size exceeded" HOT 2
- Wrong `DCMAKE_TOOLCHAIN_FILE` in docs HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hermes.