Dart is nigh impossible to embed with cmake #56750
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
triaged
Issue has been triaged by sub team
type-enhancement
A request for a change that isn't a bug
Description
I attempted to create a new C++ project with CMake that would build against Dart and execute
Dart_VersionString()
using the Dart documentation. I was unable to do it, I got as far as linking but found no way to resolve the linking errors. For example, the symbol__ZN4dart11ObjectStore19LazyInitCoreMembersEv
was in none of the build libraries.We don't have to use cmake as a build system, but we should be able to use external build systems to embed Dart.
Seen results
Unable to use the instructions in https://github.com/dart-lang/sdk/blob/main/docs/Building.md to link against a built dart.
Expected results
I should be able to wrap Dart's build system and embed dart in a cmake project.
The code
main.cc
CMakeLists.txt
Notes
fetch dart
takes about 15 minutes and 15 GB of hard drive space.FetchContent_Declare
notExternalProject_Add
to make sure the headers exist forINTERFACE_INCLUDE_DIRECTORIES
. This created a really long configure process where nothing was printed out for 15 minutes. I had to useset(FETCHCONTENT_QUIET OFF)
to avoid that.fetch dart
doesn't allow you to pin to a specific version of Dart, which is what I'd want./tools/build.py -h
$
so it can't directly be pasted into the terminal./tools/build.py runtime
to see if that gave me the proper library files to link against, that didn't work either. It wasn't clear what that actually did compared tocreate_sdk
.The text was updated successfully, but these errors were encountered: