Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
mahesh-hegde committed Jul 10, 2022
1 parent 01aef56 commit e4e3fd0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,32 @@ jobs:
parallel: true
path-to-lcov: ./jni_gen/coverage/lcov.info

test_jni_windows:
runs-on: windows-latest
defaults:
run:
working-directory: ./jni
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1.0
with:
sdk: 'stable'
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- run: |
cd src/
mkdir build
cd build
cmake ..
cmake --build .
cp Debug/dartjni.dll .
- name: Get dependencies
run: dart pub get
- name: Run tests
run: dart test

test_jni:
runs-on: ubuntu-latest
defaults:
Expand Down
11 changes: 8 additions & 3 deletions jni/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ set_target_properties(jni PROPERTIES

target_compile_definitions(jni PUBLIC DART_SHARED_LIB)

if (NOT ANDROID)
if(WIN32)
set_target_properties(${TARGET_NAME} PROPERTIES
LINK_FLAGS "/DELAYLOAD:jvm.dll")
endif()

if (ANDROID)
target_link_libraries(jni log)
else()
find_package(Java REQUIRED)
find_package(JNI REQUIRED)
include_directories(${JNI_INCLUDE_DIRS})
target_link_libraries(jni ${JNI_LIBRARIES})
else()
target_link_libraries(jni log)
endif()

0 comments on commit e4e3fd0

Please sign in to comment.