Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ git submodule update --init --recursive
cd scripts/[platform]
./build_all.sh
```

or `build_all.bat` for Windows.

Rust 1.71.0 is required. `[rustup](https://rustup.rs/) toolchain install 1.71.0-x86_64-pc-windows-msvc` for Windows.
21 changes: 21 additions & 0 deletions scripts/windows/build_all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@echo on

rem Rust 1.71.0 Windows toolchain required,
rem `rustup toolchain install 1.71.0-x86_64-pc-windows-msvc`.

set ROOT_DIR=%cd%\..\..

mkdir build

rmdir /s /q "%ROOT_DIR%\src\serai\target" 2>nul

cd "%ROOT_DIR%\src\serai\hrf" || exit
if "%IS_ARM%"=="true" (
echo Building arm frostdart
cargo +1.71.0 build --target aarch64-pc-windows-msvc --release --lib
copy "..\target\x86_64-pc-windows-msvc\release\hrf_api.dll" "%ROOT_DIR%\scripts\windows\build\frostdart.dll"
) else (
echo Building x86_64 frostdart
cargo +1.71.0 build --target x86_64-pc-windows-msvc --release --lib
copy "..\target\x86_64-pc-windows-msvc\release\hrf_api.dll" "%ROOT_DIR%\scripts\windows\build\frostdart.dll"
)
6 changes: 6 additions & 0 deletions scripts/windows/regen_bindings.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo on

cd ..
cd ..

dart run ffigen --config ffigen.yaml
11 changes: 9 additions & 2 deletions windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ cmake_minimum_required(VERSION 3.14)
set(PROJECT_NAME "frostdart")
project(${PROJECT_NAME} LANGUAGES CXX)

set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")

# Invoke the build for native code shared with the other target platforms.
# This can be changed to accommodate different builds.
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared")
# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../src" "${CMAKE_CURRENT_BINARY_DIR}/shared")
# Disabled. Library built using script in scripts/windows, re-enable this if
# /when CMakeLists builds are made to work. See also below.

# List of absolute paths to libraries that should be bundled with the plugin.
# This list could contain prebuilt libraries, or libraries created by an
# external build triggered from this build file.
set(frostdart_bundled_libraries
# Defined in ../src/CMakeLists.txt.
# This can be changed to accommodate different builds.
$<TARGET_FILE:frostdart>
# $<TARGET_FILE:frostdart>
# Disabled. Library built using script in scripts/windows, re-enable this if
# /when CMakeLists builds are made to work. See also above.
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/windows/build/frostdart.dll
PARENT_SCOPE
)