Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native macosX64 target if it runs on mac #93

Merged
merged 1 commit into from
Oct 3, 2019
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
Add native macosX64 target if it runs on mac
System.getProperty("os.name") == "Mac OS X"

./gradlew :nativesample:runReleaseExecutableMacosX64
Hello Native.

 ./nativesample/build/bin/macosX64/releaseExecutable/nativesample.kexe
Hello Native.
  • Loading branch information
Jean-Michel Fayard committed Oct 3, 2019
commit f86404d8527edff98da5df7b755363597ecfe735
9 changes: 9 additions & 0 deletions clikt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ buildscript {
}

kotlin {
def runOnMac = System.getProperty("os.name") == "Mac OS X"
targetFromPreset(presets.jvmWithJava, 'jvm')
linuxX64('linux')
mingwX64('win')
if (runOnMac) {
macosX64()
}

sourceSets {
commonMain {
Expand Down Expand Up @@ -52,6 +56,11 @@ kotlin {
configure([linuxMain, winMain]) {
dependsOn commonMain
}
if (runOnMac) {
configure(macosX64Main) {
dependsOn linuxMain
}
}
}
}

Expand Down
17 changes: 16 additions & 1 deletion nativesample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
apply plugin: 'org.jetbrains.kotlin.multiplatform'


kotlin {
def runOnMac = System.getProperty("os.name") == "Mac OS X"
if (runOnMac) macosX64 {
binaries {
executable {
entryPoint = 'com.github.ajalt.clikt.sample.main'
}
}
}
mingwX64('winX64') {
binaries {
executable {
Expand All @@ -10,10 +19,16 @@ kotlin {
}

sourceSets {
winX64Main {
main {
dependencies {
implementation project(':clikt')
}
}
if (runOnMac) configure(macosX64Main) {
dependsOn main
}
configure(winX64Main) {
dependsOn main
}
}
}