Skip to content

Commit

Permalink
Cross compile cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelsen committed Sep 19, 2024
1 parent e0f56c1 commit 773e5d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('**/build.gradle.kts') }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install libcurl4-openssl-dev
sudo apt -y update
sudo apt -y install libcurl4-openssl-dev
- name: Build with Gradle
run: ./gradlew commonBinaries
- name: Move and apply correct permissions to binary
Expand Down
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ defaultTasks("commonBinaries")
kotlin {

val hostOs = System.getProperty("os.name")
val hostArch = System.getProperty("os.arch")

// Cross Compilation

val commonTarget = when {
hostOs == "Mac OS X" -> macosArm64("common")
hostOs == "Linux" -> linuxX64("common")
hostOs == "Linux" && hostArch == "aarch64" -> linuxArm64("common")
hostOs == "Linux" && hostArch == "amd64" -> linuxX64("common")
hostOs.startsWith("Windows") -> mingwX64("common")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
Expand Down

0 comments on commit 773e5d9

Please sign in to comment.