-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Rust bindings for the runtime and the SpiderMonkey engines
- Loading branch information
1 parent
689dc97
commit cc0b178
Showing
87 changed files
with
34,630 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/crates/rust-url/Cargo.toml NO_LINKER_OVERRIDE) | ||
|
||
corrosion_import_crate( | ||
MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/runtime/crates/Cargo.toml | ||
NO_LINKER_OVERRIDE | ||
CRATE_TYPES "staticlib" | ||
IMPORTED_CRATES crates_list | ||
) | ||
|
||
#list(REMOVE_ITEM crates_list "generate-bindings") | ||
foreach (crate IN LISTS crates_list) | ||
if (crate STREQUAL "generate-bindings") | ||
continue() | ||
endif () | ||
add_dependencies("cargo-prebuild_${crate}" cargo-build_generate-bindings) | ||
endforeach () | ||
|
||
message(STATUS "Imported crates: ${crates_list}") | ||
|
||
add_library(rust-glue STATIC ${CMAKE_CURRENT_SOURCE_DIR}/runtime/crates/jsapi-rs/cpp/jsglue.cpp) | ||
target_include_directories(rust-glue PRIVATE ${SM_INCLUDE_DIR}) | ||
add_dependencies(cargo-prebuild_generate-bindings rust-glue) | ||
|
||
corrosion_set_env_vars(generate-bindings | ||
LIBCLANG_PATH=/opt/homebrew/opt/llvm/lib | ||
SYSROOT=${WASI_SDK_PREFIX}/share/wasi-sysroot | ||
CXXFLAGS="${CMAKE_CXX_FLAGS}" | ||
BIN_DIR=${CMAKE_CURRENT_BINARY_DIR} | ||
SM_HEADERS=${SM_INCLUDE_DIR} | ||
RUST_LOG=bindgen | ||
) | ||
|
||
set_property(TARGET rust-url PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/crates/rust-url/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,3 +95,5 @@ add_builtin( | |
fmt | ||
INCLUDE_DIRS | ||
runtime) | ||
|
||
add_rust_builtin(test-builtin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.