forked from kscience/kmath
Try adding Windows support
This commit is contained in:
parent
90bdf00f8b
commit
881f2280fc
34
.github/workflows/gradle.yml
vendored
34
.github/workflows/gradle.yml
vendored
@ -63,3 +63,37 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-konan-1.4.20-eap-37
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew -Dorg.gradle.daemon=false --build-cache :kmath-gsl:cinteropLibgslNative build
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Install gsl
|
||||
run: c:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-gsl
|
||||
- name: Add msys to path
|
||||
# msys installed on default image but not in path
|
||||
run: SETX PATH "%PATH%;C:\msys64\mingw64\bin"
|
||||
- name: Cache gradle
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle_6_6_1
|
||||
restore-keys: gradle_6_6_1
|
||||
|
||||
- name: Cache konan
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.konan/dependencies
|
||||
~/.konan/kotlin-native-prebuilt-mingw-1.4.20-eap-37
|
||||
key: ${{ runner.os }}-konan-1.4.20-eap-37
|
||||
restore-keys: ${{ runner.os }}-konan-1.4.20-eap-37
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew -Dorg.gradle.daemon=false --build-cache :kmath-gsl:cinteropLibgslNative build
|
||||
|
@ -5,9 +5,12 @@ plugins {
|
||||
}
|
||||
|
||||
kotlin {
|
||||
val nativeTarget = when (System.getProperty("os.name")) {
|
||||
"Mac OS X" -> macosX64("native")
|
||||
"Linux" -> linuxX64("native")
|
||||
val hostOs = System.getProperty("os.name")
|
||||
|
||||
val nativeTarget = when {
|
||||
hostOs == "Mac OS X" -> macosX64("native")
|
||||
hostOs == "Linux" -> linuxX64("native")
|
||||
hostOs.startsWith("Windows") -> mingwX64("native")
|
||||
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user