dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.2k stars 1.57k forks source link

Embedding Dart Runtime, Windows Compilation (DLL, /MD)? #44604

Open parrajustin opened 3 years ago

parrajustin commented 3 years ago

I'm attempting to embed the Dart vm into a game engine I have a few questions.

1) The command ./tools/build.py --no-goma --mode release --os host -a x64 runtime returns a static library built using the /MT runtime library which isn't all that compatible with the game engine's /MD runtime. Is it currently known if the dart runtime can be built using the different runtime library?

2) Is it possible to produce a libdart_jit.dll for embedding in windows?

3) If it is possible to build dart runtime changing the /MT[d] flags to /MD[d]. In an attempt to embed the dart vm I changed the flag to the /MD type in hopes of producing a compatible .lib file. When attempting to compile I receive numerous linking errors found HERE (All seem to be from the libdart_vm build rule, maybe?). Did I make a mistake or is there something I'm missing?

I'm hoping to use dart as scripting for the game (or possible future programs). This is also a stepping stone for me for attempting to embed flutter for building the ui inside native applications.

Thanks for any help.

vsmenon commented 3 years ago

@parrajustin - you might also consider asking in one of the venues here for a faster response: https://dart.dev/community#join-the-conversation